@rebasepro/plugin-insights 0.2.3 → 0.2.5
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/dist/common/src/collections/default-collections.d.ts +9 -0
- package/dist/common/src/collections/index.d.ts +1 -0
- package/dist/common/src/util/permissions.d.ts +1 -0
- package/dist/core/src/components/LoginView/LoginView.d.ts +25 -1
- package/dist/core/src/components/common/types.d.ts +10 -7
- package/dist/core/src/components/common/useDebouncedData.d.ts +1 -1
- package/dist/core/src/core/RebaseProps.d.ts +13 -2
- package/dist/core/src/core/RebaseRouter.d.ts +1 -1
- package/dist/core/src/hooks/data/useCollectionFetch.d.ts +12 -1
- package/dist/core/src/hooks/index.d.ts +0 -1
- package/dist/core/src/util/entity_cache.d.ts +0 -5
- package/dist/core/src/util/index.d.ts +0 -2
- package/dist/core/src/util/useStorageUploadController.d.ts +2 -2
- package/dist/formex/src/utils.d.ts +2 -2
- package/dist/index.es.js +216 -164
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +216 -164
- package/dist/index.umd.js.map +1 -1
- package/dist/plugin-insights/src/components/InsightWidget.d.ts +2 -2
- package/dist/plugin-insights/src/components/InsightWidgetSkeleton.d.ts +3 -1
- package/dist/plugin-insights/src/components/InsightsScorecardView.d.ts +3 -1
- package/dist/types/src/controllers/auth.d.ts +4 -26
- package/dist/types/src/controllers/client.d.ts +25 -43
- package/dist/types/src/controllers/collection_registry.d.ts +1 -1
- package/dist/types/src/controllers/data.d.ts +4 -0
- package/dist/types/src/controllers/data_driver.d.ts +23 -0
- package/dist/types/src/controllers/registry.d.ts +5 -4
- package/dist/types/src/rebase_context.d.ts +1 -1
- package/dist/types/src/types/auth_adapter.d.ts +5 -60
- package/dist/types/src/types/backend.d.ts +2 -2
- package/dist/types/src/types/backend_hooks.d.ts +2 -17
- package/dist/types/src/types/collections.d.ts +0 -4
- package/dist/types/src/types/component_ref.d.ts +1 -1
- package/dist/types/src/types/cron.d.ts +1 -1
- package/dist/types/src/types/entity_views.d.ts +1 -0
- package/dist/types/src/types/export_import.d.ts +1 -1
- package/dist/types/src/types/formex.d.ts +2 -2
- package/dist/types/src/types/properties.d.ts +9 -7
- package/dist/types/src/types/translations.d.ts +28 -12
- package/dist/types/src/types/user_management_delegate.d.ts +22 -57
- package/dist/types/src/users/index.d.ts +0 -1
- package/dist/types/src/users/user.d.ts +0 -1
- package/dist/ui/src/components/Button.d.ts +2 -2
- package/dist/ui/src/components/ErrorBoundary.d.ts +25 -3
- package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +6 -6
- package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +8 -8
- package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
- package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +11 -11
- package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +1 -1
- package/dist/ui/src/components/VirtualTable/types.d.ts +9 -9
- package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -1
- package/dist/ui/src/util/debounce.d.ts +1 -1
- package/package.json +4 -3
- package/src/components/InsightWidget.tsx +33 -4
- package/src/components/InsightWidgetSkeleton.tsx +7 -1
- package/src/components/InsightsScorecardView.tsx +4 -1
- package/src/engine/InsightsCache.test.ts +56 -0
- package/src/engine/useInsightsData.ts +1 -0
- package/dist/core/src/hooks/useValidateAuthenticator.d.ts +0 -21
- package/dist/core/src/util/icon_synonyms.d.ts +0 -1
- package/dist/core/src/util/useTraceUpdate.d.ts +0 -2
- package/dist/types/src/users/roles.d.ts +0 -22
|
@@ -133,7 +133,7 @@ export interface AuthUserData {
|
|
|
133
133
|
displayName?: string | null;
|
|
134
134
|
photoUrl?: string | null;
|
|
135
135
|
emailVerified?: boolean;
|
|
136
|
-
metadata?: Record<string,
|
|
136
|
+
metadata?: Record<string, unknown>;
|
|
137
137
|
createdAt?: Date;
|
|
138
138
|
updatedAt?: Date;
|
|
139
139
|
}
|
|
@@ -146,41 +146,7 @@ export interface AuthCreateUserData {
|
|
|
146
146
|
password?: string;
|
|
147
147
|
displayName?: string;
|
|
148
148
|
photoUrl?: string;
|
|
149
|
-
metadata?: Record<string,
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Role data exposed by the auth adapter.
|
|
153
|
-
* @group Auth
|
|
154
|
-
*/
|
|
155
|
-
export interface AuthRoleData {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
isAdmin: boolean;
|
|
159
|
-
defaultPermissions?: {
|
|
160
|
-
read?: boolean;
|
|
161
|
-
create?: boolean;
|
|
162
|
-
edit?: boolean;
|
|
163
|
-
delete?: boolean;
|
|
164
|
-
} | null;
|
|
165
|
-
collectionPermissions?: Record<string, {
|
|
166
|
-
read?: boolean;
|
|
167
|
-
create?: boolean;
|
|
168
|
-
edit?: boolean;
|
|
169
|
-
delete?: boolean;
|
|
170
|
-
}> | null;
|
|
171
|
-
config?: Record<string, unknown> | null;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Data for creating a role.
|
|
175
|
-
* @group Auth
|
|
176
|
-
*/
|
|
177
|
-
export interface AuthCreateRoleData {
|
|
178
|
-
id: string;
|
|
179
|
-
name: string;
|
|
180
|
-
isAdmin?: boolean;
|
|
181
|
-
defaultPermissions?: AuthRoleData["defaultPermissions"];
|
|
182
|
-
collectionPermissions?: AuthRoleData["collectionPermissions"];
|
|
183
|
-
config?: AuthRoleData["config"];
|
|
149
|
+
metadata?: Record<string, unknown>;
|
|
184
150
|
}
|
|
185
151
|
/**
|
|
186
152
|
* User management operations for the admin panel.
|
|
@@ -195,23 +161,9 @@ export interface UserManagementAdapter {
|
|
|
195
161
|
createUser(data: AuthCreateUserData): Promise<AuthUserData>;
|
|
196
162
|
updateUser(id: string, data: Partial<AuthCreateUserData>): Promise<AuthUserData | null>;
|
|
197
163
|
deleteUser(id: string): Promise<void>;
|
|
198
|
-
getUserRoles(userId: string): Promise<
|
|
164
|
+
getUserRoles(userId: string): Promise<string[]>;
|
|
199
165
|
setUserRoles(userId: string, roleIds: string[]): Promise<void>;
|
|
200
166
|
}
|
|
201
|
-
/**
|
|
202
|
-
* Role management operations for the admin panel.
|
|
203
|
-
*
|
|
204
|
-
* Optional — if not provided by the adapter, role management is disabled.
|
|
205
|
-
*
|
|
206
|
-
* @group Auth
|
|
207
|
-
*/
|
|
208
|
-
export interface RoleManagementAdapter {
|
|
209
|
-
listRoles(): Promise<AuthRoleData[]>;
|
|
210
|
-
getRoleById(id: string): Promise<AuthRoleData | null>;
|
|
211
|
-
createRole(data: AuthCreateRoleData): Promise<AuthRoleData>;
|
|
212
|
-
updateRole(id: string, data: Partial<AuthRoleData>): Promise<AuthRoleData | null>;
|
|
213
|
-
deleteRole(id: string): Promise<void>;
|
|
214
|
-
}
|
|
215
167
|
/**
|
|
216
168
|
* Pluggable authentication adapter for Rebase.
|
|
217
169
|
*
|
|
@@ -219,7 +171,7 @@ export interface RoleManagementAdapter {
|
|
|
219
171
|
* database layer. Each auth adapter knows how to:
|
|
220
172
|
*
|
|
221
173
|
* 1. Verify incoming HTTP requests (`verifyRequest`)
|
|
222
|
-
* 2. Optionally manage users
|
|
174
|
+
* 2. Optionally manage users (for the admin panel)
|
|
223
175
|
* 3. Optionally mount auth-specific routes (login, register, etc.)
|
|
224
176
|
* 4. Advertise its capabilities so the frontend can adapt
|
|
225
177
|
*
|
|
@@ -271,11 +223,6 @@ export interface AuthAdapter {
|
|
|
271
223
|
* Optional — if not provided, user management UI is hidden.
|
|
272
224
|
*/
|
|
273
225
|
userManagement?: UserManagementAdapter;
|
|
274
|
-
/**
|
|
275
|
-
* Role CRUD for the admin panel.
|
|
276
|
-
* Optional — if not provided, role management is disabled.
|
|
277
|
-
*/
|
|
278
|
-
roleManagement?: RoleManagementAdapter;
|
|
279
226
|
/**
|
|
280
227
|
* Mount adapter-specific auth routes (login, register, refresh, etc.).
|
|
281
228
|
*
|
|
@@ -291,7 +238,7 @@ export interface AuthAdapter {
|
|
|
291
238
|
*/
|
|
292
239
|
createAuthRoutes?(): Hono<any, any, any> | undefined;
|
|
293
240
|
/**
|
|
294
|
-
* Mount admin routes for user
|
|
241
|
+
* Mount admin routes for user management.
|
|
295
242
|
*
|
|
296
243
|
* Same typing rationale as `createAuthRoutes` — the sub-app env is
|
|
297
244
|
* unconstrained to support arbitrary adapter implementations.
|
|
@@ -347,8 +294,6 @@ export interface CustomAuthAdapterOptions {
|
|
|
347
294
|
verifyToken?: (token: string) => Promise<AuthenticatedUser | null>;
|
|
348
295
|
/** Optional user management for the admin panel. */
|
|
349
296
|
userManagement?: UserManagementAdapter;
|
|
350
|
-
/** Optional role management for the admin panel. */
|
|
351
|
-
roleManagement?: RoleManagementAdapter;
|
|
352
297
|
/** Static service key for server-to-server auth. */
|
|
353
298
|
serviceKey?: string;
|
|
354
299
|
/** Override default capabilities. */
|
|
@@ -527,8 +527,8 @@ export interface InitializedDriver {
|
|
|
527
527
|
export interface BootstrappedAuth {
|
|
528
528
|
/** User management service. */
|
|
529
529
|
userService: unknown;
|
|
530
|
-
/** Role management service. */
|
|
531
|
-
roleService
|
|
530
|
+
/** Role management service (optional, roles are now simple strings). */
|
|
531
|
+
roleService?: unknown;
|
|
532
532
|
/** Email service (optional). */
|
|
533
533
|
emailService?: unknown;
|
|
534
534
|
/** Combined Auth Repository for unified token and user management. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdminUser
|
|
1
|
+
import type { AdminUser } from "../controllers/client";
|
|
2
2
|
/**
|
|
3
3
|
* Context passed to every backend hook.
|
|
4
4
|
* Provides information about the request that triggered the hook.
|
|
@@ -64,19 +64,6 @@ export interface UserHooks {
|
|
|
64
64
|
*/
|
|
65
65
|
afterDelete?(userId: string, context: BackendHookContext): void | Promise<void>;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Hooks for intercepting Admin Role data at the API boundary.
|
|
69
|
-
* @group Backend Hooks
|
|
70
|
-
*/
|
|
71
|
-
export interface RoleHooks {
|
|
72
|
-
/**
|
|
73
|
-
* Transform a role record after it's read from the database,
|
|
74
|
-
* before it's returned to the client.
|
|
75
|
-
*
|
|
76
|
-
* Return the modified role, or `null` to filter it out entirely.
|
|
77
|
-
*/
|
|
78
|
-
afterRead?(role: AdminRole, context: BackendHookContext): AdminRole | null | Promise<AdminRole | null>;
|
|
79
|
-
}
|
|
80
67
|
/**
|
|
81
68
|
* Hooks for intercepting collection entity data at the REST API boundary.
|
|
82
69
|
*
|
|
@@ -146,7 +133,7 @@ export interface DataHooks {
|
|
|
146
133
|
* These hooks run server-side after database operations complete and before
|
|
147
134
|
* API responses are sent.
|
|
148
135
|
*
|
|
149
|
-
* - `users`
|
|
136
|
+
* - `users` — intercept admin user management endpoints
|
|
150
137
|
* - `data` — intercept ALL collection entity data flowing through the REST API
|
|
151
138
|
*
|
|
152
139
|
* `data` hooks complement per-collection `EntityCallbacks`. Entity callbacks
|
|
@@ -180,8 +167,6 @@ export interface DataHooks {
|
|
|
180
167
|
export interface BackendHooks {
|
|
181
168
|
/** Hooks for intercepting user management data */
|
|
182
169
|
users?: UserHooks;
|
|
183
|
-
/** Hooks for intercepting role management data */
|
|
184
|
-
roles?: RoleHooks;
|
|
185
170
|
/** Hooks for intercepting ALL collection entity data via the REST API */
|
|
186
171
|
data?: DataHooks;
|
|
187
172
|
}
|
|
@@ -589,10 +589,6 @@ export interface FilterPreset<Key extends string = string> {
|
|
|
589
589
|
*/
|
|
590
590
|
sort?: [Key, "asc" | "desc"];
|
|
591
591
|
}
|
|
592
|
-
/**
|
|
593
|
-
* @deprecated Use {@link FilterPreset} instead.
|
|
594
|
-
*/
|
|
595
|
-
export type QuickFilter<Key extends string = string> = FilterPreset<Key>;
|
|
596
592
|
/**
|
|
597
593
|
* Used to indicate valid filter combinations (e.g. created in Firestore)
|
|
598
594
|
* If the user selects a specific filter/sort combination, the CMS checks if it's
|
|
@@ -37,7 +37,7 @@ export interface LazyComponentRef<P = unknown> {
|
|
|
37
37
|
*
|
|
38
38
|
* @group Types
|
|
39
39
|
*/
|
|
40
|
-
export type ComponentRef<P =
|
|
40
|
+
export type ComponentRef<P = any> = React.ComponentType<P> | LazyComponentRef<P> | (() => Promise<{
|
|
41
41
|
default: React.ComponentType<P>;
|
|
42
42
|
}>) | string;
|
|
43
43
|
/**
|
|
@@ -44,7 +44,7 @@ export interface CronJobContext {
|
|
|
44
44
|
/** A simple logger scoped to this job run. */
|
|
45
45
|
log: (...args: unknown[]) => void;
|
|
46
46
|
/** The RebaseClient instance to interact with the database. */
|
|
47
|
-
client: RebaseClient
|
|
47
|
+
client: RebaseClient;
|
|
48
48
|
}
|
|
49
49
|
export type CronJobRunState = "idle" | "running" | "success" | "error" | "disabled";
|
|
50
50
|
/**
|
|
@@ -50,6 +50,7 @@ export interface FormContext<M extends Record<string, unknown> = Record<string,
|
|
|
50
50
|
export type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
51
51
|
key: string;
|
|
52
52
|
name: string;
|
|
53
|
+
icon?: string | React.ReactNode;
|
|
53
54
|
tabComponent?: React.ReactNode;
|
|
54
55
|
includeActions?: boolean | "bottom";
|
|
55
56
|
Builder?: ComponentRef<EntityCustomViewParams<M>>;
|
|
@@ -15,7 +15,7 @@ export interface ExportConfig<USER extends User = User> {
|
|
|
15
15
|
export interface ExportMappingFunction<USER extends User = User> {
|
|
16
16
|
key: string;
|
|
17
17
|
builder: ({ entity, context }: {
|
|
18
|
-
entity: Entity
|
|
18
|
+
entity: Entity;
|
|
19
19
|
context: RebaseContext<USER>;
|
|
20
20
|
}) => Promise<string> | string;
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FormEvent } from "react";
|
|
2
|
-
export type FormexController<T =
|
|
2
|
+
export type FormexController<T = unknown> = {
|
|
3
3
|
values: T;
|
|
4
4
|
initialValues: T;
|
|
5
5
|
setValues: (values: T) => void;
|
|
@@ -32,7 +32,7 @@ export type FormexController<T = any> = {
|
|
|
32
32
|
canUndo: boolean;
|
|
33
33
|
canRedo: boolean;
|
|
34
34
|
};
|
|
35
|
-
export type FormexResetProps<T =
|
|
35
|
+
export type FormexResetProps<T = unknown> = {
|
|
36
36
|
values?: T;
|
|
37
37
|
submitCount?: number;
|
|
38
38
|
errors?: Record<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentRef } from "./component_ref";
|
|
2
|
-
import type { EntityReference, EntityRelation, EntityValues, GeoPoint,
|
|
3
|
-
import type {
|
|
2
|
+
import type { Entity, EntityReference, EntityRelation, EntityValues, GeoPoint, Vector } from "./entities";
|
|
3
|
+
import type { JoinStep, OnAction, Relation } from "./relations";
|
|
4
4
|
import type { EntityCollection, FilterValues } from "./collections";
|
|
5
5
|
import type { ColorKey, ColorScheme } from "./chips";
|
|
6
6
|
import type { AuthController } from "../controllers/auth";
|
|
@@ -104,8 +104,8 @@ export interface BaseUIConfig<CustomProps = unknown> {
|
|
|
104
104
|
disabled?: boolean | PropertyDisabledConfig;
|
|
105
105
|
widthPercentage?: number;
|
|
106
106
|
customProps?: CustomProps;
|
|
107
|
-
Field?: ComponentRef
|
|
108
|
-
Preview?: ComponentRef
|
|
107
|
+
Field?: ComponentRef;
|
|
108
|
+
Preview?: ComponentRef;
|
|
109
109
|
}
|
|
110
110
|
export interface BaseProperty<CustomProps = unknown> {
|
|
111
111
|
ui?: BaseUIConfig<CustomProps>;
|
|
@@ -185,7 +185,7 @@ export interface StringProperty extends BaseProperty {
|
|
|
185
185
|
* Optional database column type. If not set, it defaults to `varchar` or `uuid` depending on `isId` configuration.
|
|
186
186
|
* Use `text` for strings with unbound length, `char` for fixed-length strings, or `varchar` for variable-length strings with a limit.
|
|
187
187
|
*/
|
|
188
|
-
columnType?: "varchar" | "text" | "char";
|
|
188
|
+
columnType?: "varchar" | "text" | "char" | "uuid";
|
|
189
189
|
/**
|
|
190
190
|
* Rules for validating this property
|
|
191
191
|
*/
|
|
@@ -541,9 +541,11 @@ export interface ArrayProperty extends BaseProperty {
|
|
|
541
541
|
ui?: ArrayUIConfig;
|
|
542
542
|
type: "array";
|
|
543
543
|
/**
|
|
544
|
-
* Optional database column type.
|
|
544
|
+
* Optional database column type. By default, maps to a native Postgres array
|
|
545
|
+
* (e.g. `text[]`, `integer[]`/`numeric[]`, `boolean[]`) if the element type
|
|
546
|
+
* is a primitive, otherwise defaults to `jsonb`.
|
|
545
547
|
*/
|
|
546
|
-
columnType?: "json" | "jsonb";
|
|
548
|
+
columnType?: "json" | "jsonb" | "text[]" | "integer[]" | "boolean[]" | "numeric[]";
|
|
547
549
|
/**
|
|
548
550
|
* The property of this array.
|
|
549
551
|
* You can specify any property (except another Array property)
|
|
@@ -105,6 +105,12 @@ export interface RebaseTranslations {
|
|
|
105
105
|
navigation_drawer: string;
|
|
106
106
|
collapse: string;
|
|
107
107
|
expand: string;
|
|
108
|
+
/** Tooltip for the language switcher in the drawer footer */
|
|
109
|
+
change_language?: string;
|
|
110
|
+
/** Tooltip for the theme toggle in the drawer footer */
|
|
111
|
+
toggle_theme?: string;
|
|
112
|
+
/** Aria label for the user menu trigger in the drawer footer */
|
|
113
|
+
user_menu?: string;
|
|
108
114
|
error: string;
|
|
109
115
|
error_uploading_file: string;
|
|
110
116
|
error_deleting: string;
|
|
@@ -426,18 +432,28 @@ export interface RebaseTranslations {
|
|
|
426
432
|
deleted: string;
|
|
427
433
|
select_reference: string;
|
|
428
434
|
select_references: string;
|
|
429
|
-
account_settings
|
|
430
|
-
profile
|
|
431
|
-
sessions
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
435
|
+
account_settings?: string;
|
|
436
|
+
profile?: string;
|
|
437
|
+
sessions?: string;
|
|
438
|
+
security?: string;
|
|
439
|
+
change_password?: string;
|
|
440
|
+
current_password?: string;
|
|
441
|
+
new_password?: string;
|
|
442
|
+
confirm_password?: string;
|
|
443
|
+
password_changed?: string;
|
|
444
|
+
passwords_dont_match?: string;
|
|
445
|
+
password_too_short?: string;
|
|
446
|
+
password_change_not_available?: string;
|
|
447
|
+
changing_password?: string;
|
|
448
|
+
display_name?: string;
|
|
449
|
+
photo_url?: string;
|
|
450
|
+
save_profile?: string;
|
|
451
|
+
saving?: string;
|
|
452
|
+
no_active_sessions?: string;
|
|
453
|
+
revoking?: string;
|
|
454
|
+
revoke_all_sessions?: string;
|
|
455
|
+
unknown_device?: string;
|
|
456
|
+
current?: string;
|
|
441
457
|
role_id: string;
|
|
442
458
|
role_name: string;
|
|
443
459
|
add_reference: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { User } from "../users";
|
|
2
2
|
/**
|
|
3
3
|
* Result of creating a new user via admin flow.
|
|
4
4
|
* Contains the created user plus information about how credentials were delivered.
|
|
@@ -15,56 +15,46 @@ export interface UserCreationResult<USER extends User = User> {
|
|
|
15
15
|
temporaryPassword?: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Delegate to manage
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Delegate to manage auth-specific user operations.
|
|
19
|
+
*
|
|
20
|
+
* This interface allows the CMS to be agnostic of the underlying
|
|
21
|
+
* authentication provider or backend. User/role CRUD is now handled
|
|
22
|
+
* by the collection system; this delegate only exposes auth-specific
|
|
23
|
+
* operations (password hashing, invitations, bootstrap).
|
|
21
24
|
*
|
|
22
25
|
* @group Models
|
|
23
26
|
*/
|
|
24
27
|
export interface UserManagementDelegate<USER extends User = User> {
|
|
25
28
|
/**
|
|
26
|
-
* Are
|
|
29
|
+
* Are auth-related operations currently loading?
|
|
27
30
|
*/
|
|
28
31
|
loading: boolean;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
33
|
+
* In-memory list of users (used for client-side filtering fallback).
|
|
31
34
|
*/
|
|
32
|
-
users
|
|
35
|
+
users?: USER[];
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* Error from fetching the users list, if any.
|
|
35
38
|
*/
|
|
36
39
|
usersError?: Error;
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
39
|
-
* user information when assigning ownership of an entity.
|
|
40
|
-
* @param uid
|
|
41
|
+
* Look up a single user by UID from the in-memory cache.
|
|
41
42
|
*/
|
|
42
|
-
getUser
|
|
43
|
+
getUser?: (uid: string) => USER | null;
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
* When provided, the CMS will use this for the users table
|
|
46
|
-
* instead of loading all users into memory.
|
|
45
|
+
* Server-side user search with pagination.
|
|
47
46
|
*/
|
|
48
|
-
searchUsers?: (
|
|
47
|
+
searchUsers?: (params: {
|
|
49
48
|
search?: string;
|
|
50
49
|
limit?: number;
|
|
51
50
|
offset?: number;
|
|
52
|
-
orderBy?: string;
|
|
53
|
-
orderDir?: "asc" | "desc";
|
|
54
|
-
roleId?: string;
|
|
55
51
|
}) => Promise<{
|
|
56
52
|
users: USER[];
|
|
57
53
|
total: number;
|
|
58
54
|
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Save a user (create or update)
|
|
61
|
-
* @param user
|
|
62
|
-
*/
|
|
63
|
-
saveUser?: (user: USER) => Promise<USER>;
|
|
64
55
|
/**
|
|
65
56
|
* Create a new user with invitation/password generation support.
|
|
66
57
|
* Returns additional info about how the credentials were delivered.
|
|
67
|
-
* Falls back to saveUser if not provided.
|
|
68
58
|
*/
|
|
69
59
|
createUser?: (user: USER) => Promise<UserCreationResult<USER>>;
|
|
70
60
|
/**
|
|
@@ -73,46 +63,21 @@ export interface UserManagementDelegate<USER extends User = User> {
|
|
|
73
63
|
* or a flag indicating an email invitation was sent.
|
|
74
64
|
*/
|
|
75
65
|
resetPassword?: (user: USER) => Promise<UserCreationResult<USER>>;
|
|
76
|
-
/**
|
|
77
|
-
* Delete a user
|
|
78
|
-
* @param user
|
|
79
|
-
*/
|
|
80
|
-
deleteUser?: (user: USER) => Promise<void>;
|
|
81
|
-
/**
|
|
82
|
-
* List of roles defined in the CMS.
|
|
83
|
-
*/
|
|
84
|
-
roles?: Role[];
|
|
85
|
-
/**
|
|
86
|
-
* Optional error if roles failed to load.
|
|
87
|
-
*/
|
|
88
|
-
rolesError?: Error;
|
|
89
|
-
/**
|
|
90
|
-
* Save a role (create or update)
|
|
91
|
-
* @param role
|
|
92
|
-
*/
|
|
93
|
-
saveRole?: (role: Role) => Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Delete a role
|
|
96
|
-
* @param role
|
|
97
|
-
*/
|
|
98
|
-
deleteRole?: (role: Role) => Promise<void>;
|
|
99
66
|
/**
|
|
100
67
|
* Is the currently logged in user an admin?
|
|
101
68
|
*/
|
|
102
69
|
isAdmin?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* If true, the UI will allow the user to create the default roles (admin, editor, viewer).
|
|
105
|
-
*/
|
|
106
|
-
allowDefaultRolesCreation?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Should collection config permissions be included?
|
|
109
|
-
*/
|
|
110
|
-
includeCollectionConfigPermissions?: boolean;
|
|
111
70
|
/**
|
|
112
71
|
* Optionally define roles for a given user. This is useful when the roles
|
|
113
72
|
* are coming from a separate provider than the one issuing the tokens.
|
|
114
73
|
*/
|
|
115
|
-
defineRolesFor?: (user: USER) => Promise<
|
|
74
|
+
defineRolesFor?: (user: USER) => Promise<string[] | undefined> | string[] | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Whether any admin users exist. Used by the bootstrap banner to decide
|
|
77
|
+
* whether to prompt. Populated via a lightweight check (e.g. `limit=1`
|
|
78
|
+
* query) instead of loading all users.
|
|
79
|
+
*/
|
|
80
|
+
hasAdminUsers?: boolean;
|
|
116
81
|
/**
|
|
117
82
|
* Optional function to bootstrap an admin user.
|
|
118
83
|
* Often used when the database is empty.
|
|
@@ -9,6 +9,6 @@ export type ButtonProps<C extends React.ElementType = "button"> = {
|
|
|
9
9
|
fullWidth?: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
component?: C;
|
|
12
|
-
onClick?: React.MouseEventHandler<
|
|
12
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
13
13
|
} & React.ComponentPropsWithoutRef<C>;
|
|
14
|
-
export declare const Button: React.FC<ButtonProps<
|
|
14
|
+
export declare const Button: React.FC<ButtonProps<React.ElementType>>;
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import React, { ErrorInfo, PropsWithChildren } from "react";
|
|
2
|
-
export
|
|
2
|
+
export interface ErrorBoundaryProps {
|
|
3
|
+
/**
|
|
4
|
+
* When true, renders a full-page centered error screen instead of the
|
|
5
|
+
* compact inline error. Intended for wrapping top-level app roots or
|
|
6
|
+
* major route sections.
|
|
7
|
+
*/
|
|
8
|
+
fullPage?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Optional callback invoked when the user clicks "Try again". If provided,
|
|
11
|
+
* the boundary resets its error state and calls this handler. If omitted,
|
|
12
|
+
* the "Try again" button resets the boundary state, re-mounting children.
|
|
13
|
+
*/
|
|
14
|
+
onReset?: () => void;
|
|
15
|
+
}
|
|
16
|
+
interface ErrorBoundaryState {
|
|
3
17
|
error: Error | null;
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
showDetails: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class ErrorBoundary extends React.Component<PropsWithChildren<ErrorBoundaryProps>, ErrorBoundaryState> {
|
|
21
|
+
constructor(props: PropsWithChildren<ErrorBoundaryProps>);
|
|
6
22
|
static getDerivedStateFromError(error: Error): {
|
|
7
23
|
error: Error;
|
|
8
24
|
};
|
|
9
25
|
componentDidCatch(error: Error, _errorInfo: ErrorInfo): void;
|
|
26
|
+
private handleReset;
|
|
27
|
+
private handleReload;
|
|
28
|
+
private toggleDetails;
|
|
10
29
|
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
30
|
+
private renderInline;
|
|
31
|
+
private renderFullPage;
|
|
11
32
|
}
|
|
33
|
+
export {};
|
|
@@ -8,4 +8,4 @@ import { VirtualTableProps } from "./VirtualTableProps";
|
|
|
8
8
|
*
|
|
9
9
|
* @group Components
|
|
10
10
|
*/
|
|
11
|
-
export declare const VirtualTable: React.NamedExoticComponent<VirtualTableProps<
|
|
11
|
+
export declare const VirtualTable: React.NamedExoticComponent<VirtualTableProps<Record<string, unknown>>>;
|
|
@@ -4,18 +4,18 @@ type VirtualTableCellProps<T> = {
|
|
|
4
4
|
dataKey: string;
|
|
5
5
|
column: VirtualTableColumn;
|
|
6
6
|
columns: VirtualTableColumn[];
|
|
7
|
-
rowData:
|
|
8
|
-
cellData:
|
|
9
|
-
rowIndex:
|
|
7
|
+
rowData: T;
|
|
8
|
+
cellData: unknown;
|
|
9
|
+
rowIndex: number;
|
|
10
10
|
columnIndex: number;
|
|
11
11
|
cellRenderer: (props: CellRendererParams<T>) => React.ReactNode;
|
|
12
12
|
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
13
13
|
sortableStyle?: React.CSSProperties;
|
|
14
|
-
sortableAttributes?: Record<string,
|
|
14
|
+
sortableAttributes?: Record<string, unknown>;
|
|
15
15
|
isDragging?: boolean;
|
|
16
16
|
isDraggable?: boolean;
|
|
17
17
|
frozen?: boolean;
|
|
18
|
-
extraData?:
|
|
18
|
+
extraData?: unknown;
|
|
19
19
|
};
|
|
20
|
-
export declare const VirtualTableCell: React.NamedExoticComponent<VirtualTableCellProps<
|
|
20
|
+
export declare const VirtualTableCell: React.NamedExoticComponent<VirtualTableCellProps<unknown>>;
|
|
21
21
|
export {};
|
|
@@ -2,28 +2,28 @@ import React from "react";
|
|
|
2
2
|
import { VirtualTableColumn, VirtualTableSort, VirtualTableWhereFilterOp } from "./VirtualTableProps";
|
|
3
3
|
export type FilterFormFieldProps<CustomProps> = {
|
|
4
4
|
id: React.Key;
|
|
5
|
-
filterValue: [VirtualTableWhereFilterOp,
|
|
6
|
-
setFilterValue: (filterValue?: [VirtualTableWhereFilterOp,
|
|
5
|
+
filterValue: [VirtualTableWhereFilterOp, unknown] | undefined;
|
|
6
|
+
setFilterValue: (filterValue?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
7
7
|
column: VirtualTableColumn<CustomProps>;
|
|
8
8
|
hidden: boolean;
|
|
9
9
|
setHidden: (hidden: boolean) => void;
|
|
10
10
|
};
|
|
11
|
-
type VirtualTableHeaderProps<M extends Record<string,
|
|
11
|
+
type VirtualTableHeaderProps<M extends Record<string, unknown>> = {
|
|
12
12
|
resizeHandleRef: React.Ref<HTMLDivElement>;
|
|
13
13
|
columnIndex: number;
|
|
14
14
|
isResizingIndex: number;
|
|
15
|
-
column: VirtualTableColumn<
|
|
15
|
+
column: VirtualTableColumn<unknown>;
|
|
16
16
|
onColumnSort: (key: Extract<keyof M, string>) => void;
|
|
17
|
-
filter?: [VirtualTableWhereFilterOp,
|
|
17
|
+
filter?: [VirtualTableWhereFilterOp, unknown];
|
|
18
18
|
sort: VirtualTableSort;
|
|
19
|
-
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp,
|
|
19
|
+
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
20
20
|
onClickResizeColumn?: (columnIndex: number, column: VirtualTableColumn) => void;
|
|
21
|
-
createFilterField?: (props: FilterFormFieldProps<
|
|
21
|
+
createFilterField?: (props: FilterFormFieldProps<unknown>) => React.ReactNode;
|
|
22
22
|
AdditionalHeaderWidget?: (props: {
|
|
23
23
|
onHover: boolean;
|
|
24
24
|
}) => React.ReactNode;
|
|
25
25
|
isDragging?: boolean;
|
|
26
26
|
isDraggable?: boolean;
|
|
27
27
|
};
|
|
28
|
-
export declare const VirtualTableHeader: React.FunctionComponent<VirtualTableHeaderProps<
|
|
28
|
+
export declare const VirtualTableHeader: React.FunctionComponent<VirtualTableHeaderProps<Record<string, unknown>>>;
|
|
29
29
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { VirtualTableContextProps } from "./types";
|
|
2
|
-
export declare const VirtualTableHeaderRow: ({ columns, currentSort, onColumnSort, onFilterUpdate, sortByProperty, filter, onColumnResize, onColumnResizeEnd, createFilterField, AddColumnComponent, onColumnsOrderChange, data, cellRenderer: CellRenderer, rowHeight, draggingColumnId, headerHeight }: VirtualTableContextProps<
|
|
2
|
+
export declare const VirtualTableHeaderRow: ({ columns, currentSort, onColumnSort, onFilterUpdate, sortByProperty, filter, onColumnResize, onColumnResizeEnd, createFilterField, AddColumnComponent, onColumnsOrderChange, data, cellRenderer: CellRenderer, rowHeight, draggingColumnId, headerHeight }: VirtualTableContextProps<Record<string, unknown>>) => import("react/jsx-runtime").JSX.Element;
|