@rebasepro/studio 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/{ApiExplorer-BmcdhAX0.js → ApiExplorer-CGHEF1uL.js} +4 -4
- package/dist/ApiExplorer-CGHEF1uL.js.map +1 -0
- package/dist/{CronJobsView-CNfz0etw.js → CronJobsView-3PM_qR8v.js} +20 -3
- package/dist/CronJobsView-3PM_qR8v.js.map +1 -0
- package/dist/{JSEditor-Ch8z8lJ4.js → JSEditor-BCSoElPg.js} +26 -36
- package/dist/JSEditor-BCSoElPg.js.map +1 -0
- package/dist/LogsExplorer-_4sZadKn.js +162 -0
- package/dist/LogsExplorer-_4sZadKn.js.map +1 -0
- package/dist/{SQLEditor-BELYJQRP.js → SQLEditor-BC0IOUQu.js} +4 -4
- package/dist/SQLEditor-BC0IOUQu.js.map +1 -0
- 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 +23 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +228 -44
- package/dist/index.umd.js.map +1 -1
- package/dist/studio/src/components/ApiExplorer/parseSpec.d.ts +1 -1
- package/dist/studio/src/components/ApiExplorer/types.d.ts +3 -3
- package/dist/studio/src/components/LogsExplorer/LogsExplorer.d.ts +1 -0
- 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 +8 -8
- package/src/components/ApiExplorer/ApiExplorer.tsx +2 -2
- package/src/components/ApiExplorer/EndpointDetail.tsx +1 -1
- package/src/components/ApiExplorer/TryItPanel.tsx +5 -5
- package/src/components/ApiExplorer/parseSpec.ts +3 -3
- package/src/components/ApiExplorer/types.ts +3 -3
- package/src/components/CronJobs/CronJobsView.tsx +27 -2
- package/src/components/JSEditor/JSEditor.tsx +21 -18
- package/src/components/JSEditor/JSMonacoEditor.tsx +6 -19
- package/src/components/LogsExplorer/LogsExplorer.tsx +224 -0
- package/src/components/RebaseStudio.tsx +10 -1
- package/src/components/SQLEditor/SQLEditor.tsx +28 -7
- package/src/components/StudioHomePage.tsx +2 -1
- package/src/utils/parseSpec.test.ts +274 -0
- package/src/utils/pgColumnToProperty.test.ts +1 -0
- package/src/utils/pgColumnToProperty.ts +35 -4
- package/dist/ApiExplorer-BmcdhAX0.js.map +0 -1
- package/dist/CronJobsView-CNfz0etw.js.map +0 -1
- package/dist/JSEditor-Ch8z8lJ4.js.map +0 -1
- package/dist/SQLEditor-BELYJQRP.js.map +0 -1
- 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
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterFormFieldProps } from "./VirtualTableHeader";
|
|
3
|
-
export type OnRowClickParams<T extends Record<string,
|
|
3
|
+
export type OnRowClickParams<T extends Record<string, unknown>> = {
|
|
4
4
|
rowData: T;
|
|
5
5
|
rowIndex: number;
|
|
6
6
|
event: React.SyntheticEvent;
|
|
@@ -9,7 +9,7 @@ export type OnRowClickParams<T extends Record<string, any>> = {
|
|
|
9
9
|
* @see Table
|
|
10
10
|
* @group Components
|
|
11
11
|
*/
|
|
12
|
-
export interface VirtualTableProps<T extends Record<string,
|
|
12
|
+
export interface VirtualTableProps<T extends Record<string, unknown>> {
|
|
13
13
|
/**
|
|
14
14
|
* Array of arbitrary data
|
|
15
15
|
*/
|
|
@@ -61,12 +61,12 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
61
61
|
/**
|
|
62
62
|
* In case this table should have some filters set by default
|
|
63
63
|
*/
|
|
64
|
-
filter?: VirtualTableFilterValues<
|
|
64
|
+
filter?: VirtualTableFilterValues<string>;
|
|
65
65
|
/**
|
|
66
66
|
* Callback used when filters are updated
|
|
67
67
|
* @param filter
|
|
68
68
|
*/
|
|
69
|
-
onFilterUpdate?: (filter?: VirtualTableFilterValues<
|
|
69
|
+
onFilterUpdate?: (filter?: VirtualTableFilterValues<string> | undefined) => void;
|
|
70
70
|
/**
|
|
71
71
|
* Callback when the table is scrolled
|
|
72
72
|
* @param props
|
|
@@ -111,7 +111,7 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
111
111
|
* Callback to create a filter field, displayed in the header as a dropdown
|
|
112
112
|
* @param props
|
|
113
113
|
*/
|
|
114
|
-
createFilterField?: (props: FilterFormFieldProps<
|
|
114
|
+
createFilterField?: (props: FilterFormFieldProps<unknown>) => React.ReactNode;
|
|
115
115
|
/**
|
|
116
116
|
* Class name applied to the table
|
|
117
117
|
*/
|
|
@@ -141,9 +141,9 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
141
141
|
/**
|
|
142
142
|
* Extra data passed to the cell renderer
|
|
143
143
|
*/
|
|
144
|
-
extraData?:
|
|
144
|
+
extraData?: unknown;
|
|
145
145
|
}
|
|
146
|
-
export type CellRendererParams<T =
|
|
146
|
+
export type CellRendererParams<T = unknown> = {
|
|
147
147
|
column: VirtualTableColumn;
|
|
148
148
|
columns: VirtualTableColumn[];
|
|
149
149
|
columnIndex: number;
|
|
@@ -153,17 +153,17 @@ export type CellRendererParams<T = any> = {
|
|
|
153
153
|
isScrolling?: boolean;
|
|
154
154
|
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
155
155
|
sortableStyle?: React.CSSProperties;
|
|
156
|
-
sortableAttributes?: Record<string,
|
|
156
|
+
sortableAttributes?: Record<string, unknown>;
|
|
157
157
|
isDragging?: boolean;
|
|
158
158
|
isDraggable?: boolean;
|
|
159
159
|
frozen?: boolean;
|
|
160
|
-
extraData?:
|
|
160
|
+
extraData?: unknown;
|
|
161
161
|
};
|
|
162
162
|
/**
|
|
163
163
|
* @see Table
|
|
164
164
|
* @group Components
|
|
165
165
|
*/
|
|
166
|
-
export interface VirtualTableColumn<CustomProps =
|
|
166
|
+
export interface VirtualTableColumn<CustomProps = unknown> {
|
|
167
167
|
/**
|
|
168
168
|
* Data key for the cell value, could be "a.b.c"
|
|
169
169
|
*/
|
|
@@ -233,7 +233,7 @@ export type VirtualTableSort = "asc" | "desc" | undefined;
|
|
|
233
233
|
* @see Table
|
|
234
234
|
* @group Components
|
|
235
235
|
*/
|
|
236
|
-
export type VirtualTableFilterValues<Key extends string> = Partial<Record<Key, [VirtualTableWhereFilterOp,
|
|
236
|
+
export type VirtualTableFilterValues<Key extends string> = Partial<Record<Key, [VirtualTableWhereFilterOp, unknown]>>;
|
|
237
237
|
/**
|
|
238
238
|
* Filter conditions in a `Query.where()` clause are specified using the
|
|
239
239
|
* strings `<`, `<=`, `==`, `>=`, `>`, `array-contains`, `in`, and `array-contains-any`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { VirtualTableRowProps } from "./types";
|
|
3
|
-
export declare const VirtualTableRow: React.NamedExoticComponent<VirtualTableRowProps<
|
|
3
|
+
export declare const VirtualTableRow: React.NamedExoticComponent<VirtualTableRowProps<Record<string, unknown>>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CellRendererParams, OnRowClickParams, OnVirtualTableColumnResizeParams, VirtualTableColumn, VirtualTableFilterValues, VirtualTableWhereFilterOp } from "./VirtualTableProps";
|
|
3
3
|
import { FilterFormFieldProps } from "./VirtualTableHeader";
|
|
4
|
-
export type VirtualTableRowProps<T
|
|
5
|
-
style:
|
|
4
|
+
export type VirtualTableRowProps<T extends Record<string, unknown>> = {
|
|
5
|
+
style: React.CSSProperties;
|
|
6
6
|
rowHeight: number;
|
|
7
7
|
rowData: T;
|
|
8
8
|
rowIndex: number;
|
|
9
|
-
onRowClick?: (props: OnRowClickParams<
|
|
9
|
+
onRowClick?: (props: OnRowClickParams<Record<string, unknown>>) => void;
|
|
10
10
|
children: React.ReactNode[];
|
|
11
11
|
columns: VirtualTableColumn[];
|
|
12
12
|
hoverRow?: boolean;
|
|
@@ -19,20 +19,20 @@ export type VirtualTableContextProps<T> = {
|
|
|
19
19
|
columns: VirtualTableColumn[];
|
|
20
20
|
cellRenderer: React.ComponentType<CellRendererParams<T>>;
|
|
21
21
|
currentSort: "asc" | "desc" | undefined;
|
|
22
|
-
filter?: VirtualTableFilterValues<
|
|
23
|
-
onRowClick?: (props: OnRowClickParams<
|
|
24
|
-
onColumnSort: (key: string) =>
|
|
22
|
+
filter?: VirtualTableFilterValues<string>;
|
|
23
|
+
onRowClick?: (props: OnRowClickParams<Record<string, unknown>>) => void;
|
|
24
|
+
onColumnSort: (key: string) => void;
|
|
25
25
|
onColumnResize: (params: OnVirtualTableColumnResizeParams) => void;
|
|
26
26
|
onColumnResizeEnd: (params: OnVirtualTableColumnResizeParams) => void;
|
|
27
|
-
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp,
|
|
27
|
+
onFilterUpdate: (column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
28
28
|
sortByProperty?: string;
|
|
29
29
|
customView?: React.ReactNode;
|
|
30
30
|
hoverRow: boolean;
|
|
31
|
-
createFilterField?: (props: FilterFormFieldProps<
|
|
31
|
+
createFilterField?: (props: FilterFormFieldProps<unknown>) => React.ReactNode;
|
|
32
32
|
rowClassName?: (rowData: T) => string | undefined;
|
|
33
33
|
endAdornment?: React.ReactNode;
|
|
34
34
|
AddColumnComponent?: React.ComponentType;
|
|
35
35
|
onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
|
|
36
36
|
draggingColumnId?: string | null;
|
|
37
|
-
extraData?:
|
|
37
|
+
extraData?: unknown;
|
|
38
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useDebounceCallback<T extends (...args: any[]) =>
|
|
1
|
+
export declare function useDebounceCallback<T extends (...args: any[]) => unknown>(callback?: T, delay?: number): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @ignore
|
|
3
3
|
*/
|
|
4
|
-
export declare function debounce<T extends (...args: any[]) =>
|
|
4
|
+
export declare function debounce<T extends (...args: any[]) => unknown>(func: T, wait?: number): T & Cancelable;
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/studio",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"types": "dist/studio/src/index.d.ts",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"pgsql-ast-parser": "12.0.2",
|
|
16
16
|
"prism-react-renderer": "^2.4.1",
|
|
17
17
|
"react-dropzone": "^14.4.1",
|
|
18
|
-
"@rebasepro/common": "0.2.
|
|
19
|
-
"@rebasepro/client": "0.2.
|
|
20
|
-
"@rebasepro/core": "0.2.
|
|
21
|
-
"@rebasepro/
|
|
22
|
-
"@rebasepro/
|
|
23
|
-
"@rebasepro/
|
|
18
|
+
"@rebasepro/common": "0.2.5",
|
|
19
|
+
"@rebasepro/client": "0.2.5",
|
|
20
|
+
"@rebasepro/core": "0.2.5",
|
|
21
|
+
"@rebasepro/ui": "0.2.5",
|
|
22
|
+
"@rebasepro/utils": "0.2.5",
|
|
23
|
+
"@rebasepro/types": "0.2.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": ">=19.0.0",
|
|
27
27
|
"react-dom": ">=19.0.0",
|
|
28
28
|
"react-router": "^7.0.0",
|
|
29
29
|
"react-router-dom": "^7.0.0",
|
|
30
|
-
"@rebasepro/admin": "0.2.
|
|
30
|
+
"@rebasepro/admin": "0.2.5"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
"@rebasepro/admin": {
|
|
@@ -50,9 +50,9 @@ export function ApiExplorer() {
|
|
|
50
50
|
setSpec(data);
|
|
51
51
|
setLoading(false);
|
|
52
52
|
}
|
|
53
|
-
} catch (err:
|
|
53
|
+
} catch (err: unknown) {
|
|
54
54
|
if (!cancelled) {
|
|
55
|
-
setError(err.message
|
|
55
|
+
setError(err instanceof Error ? err.message : "Failed to load API spec");
|
|
56
56
|
setLoading(false);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -153,7 +153,7 @@ function SchemaBlock({ schema, spec, depth }: { schema: OpenApiSchema; spec: Ope
|
|
|
153
153
|
// Resolve $ref
|
|
154
154
|
if (schema.$ref) {
|
|
155
155
|
const name = resolveRefName(schema.$ref);
|
|
156
|
-
const resolved = resolveRef(spec, schema.$ref);
|
|
156
|
+
const resolved = resolveRef(spec, schema.$ref) as OpenApiSchema;
|
|
157
157
|
return (
|
|
158
158
|
<div>
|
|
159
159
|
<Typography
|
|
@@ -125,8 +125,8 @@ export function TryItPanel({ endpoint, apiUrl, getAuthToken, user, basePath = ""
|
|
|
125
125
|
if (hasBody && body.trim()) {
|
|
126
126
|
try {
|
|
127
127
|
JSON.parse(body);
|
|
128
|
-
} catch (err:
|
|
129
|
-
setValidationError(`Invalid JSON: ${err.message}`);
|
|
128
|
+
} catch (err: unknown) {
|
|
129
|
+
setValidationError(`Invalid JSON: ${err instanceof Error ? err.message : String(err)}`);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
@@ -171,11 +171,11 @@ export function TryItPanel({ endpoint, apiUrl, getAuthToken, user, basePath = ""
|
|
|
171
171
|
statusText: res.statusText,
|
|
172
172
|
body: text,
|
|
173
173
|
time: elapsed });
|
|
174
|
-
} catch (err:
|
|
174
|
+
} catch (err: unknown) {
|
|
175
175
|
setResponse({
|
|
176
176
|
status: 0,
|
|
177
177
|
statusText: "Network Error",
|
|
178
|
-
body: err.message
|
|
178
|
+
body: err instanceof Error ? err.message : "Request failed",
|
|
179
179
|
time: Math.round(performance.now() - start)
|
|
180
180
|
});
|
|
181
181
|
} finally {
|
|
@@ -479,7 +479,7 @@ function buildBodyTemplate(endpoint: ParsedEndpoint): string {
|
|
|
479
479
|
return lines.join("\n");
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
function defaultValue(schema:
|
|
482
|
+
function defaultValue(schema: { type?: string; format?: string; enum?: (string | number)[] }): string {
|
|
483
483
|
if (schema.enum) return JSON.stringify(schema.enum[0]);
|
|
484
484
|
switch (schema.type) {
|
|
485
485
|
case "string":
|
|
@@ -94,11 +94,11 @@ export function resolveRefName(ref: string): string {
|
|
|
94
94
|
/**
|
|
95
95
|
* Resolve a $ref to its actual schema from the spec.
|
|
96
96
|
*/
|
|
97
|
-
export function resolveRef(spec: OpenApiSpec, ref: string):
|
|
97
|
+
export function resolveRef(spec: OpenApiSpec, ref: string): unknown {
|
|
98
98
|
const parts = ref.replace("#/", "").split("/");
|
|
99
|
-
let current:
|
|
99
|
+
let current: unknown = spec;
|
|
100
100
|
for (const part of parts) {
|
|
101
|
-
current = current?.[part];
|
|
101
|
+
current = (current as Record<string, unknown>)?.[part];
|
|
102
102
|
}
|
|
103
103
|
return current ?? {};
|
|
104
104
|
}
|
|
@@ -6,7 +6,7 @@ export interface OpenApiSpec {
|
|
|
6
6
|
paths: Record<string, Record<string, OpenApiOperation>>;
|
|
7
7
|
components?: {
|
|
8
8
|
schemas?: Record<string, OpenApiSchema>;
|
|
9
|
-
securitySchemes?: Record<string,
|
|
9
|
+
securitySchemes?: Record<string, unknown>;
|
|
10
10
|
};
|
|
11
11
|
tags?: { name: string; description?: string }[];
|
|
12
12
|
security?: Record<string, string[]>[];
|
|
@@ -57,8 +57,8 @@ export interface OpenApiSchema {
|
|
|
57
57
|
maximum?: number;
|
|
58
58
|
maxLength?: number;
|
|
59
59
|
minLength?: number;
|
|
60
|
-
default?:
|
|
61
|
-
example?:
|
|
60
|
+
default?: unknown;
|
|
61
|
+
example?: unknown;
|
|
62
62
|
additionalProperties?: boolean | OpenApiSchema;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -91,8 +91,33 @@ export function CronJobsView() {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
load();
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
|
|
95
|
+
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
96
|
+
|
|
97
|
+
const scheduleNext = () => {
|
|
98
|
+
if (cancelled) return;
|
|
99
|
+
timeoutId = setTimeout(async () => {
|
|
100
|
+
if (document.visibilityState === "visible") {
|
|
101
|
+
await load();
|
|
102
|
+
}
|
|
103
|
+
scheduleNext();
|
|
104
|
+
}, 15_000);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
scheduleNext();
|
|
108
|
+
|
|
109
|
+
const handleVisibility = () => {
|
|
110
|
+
if (document.visibilityState === "visible") {
|
|
111
|
+
load();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
document.addEventListener("visibilitychange", handleVisibility);
|
|
115
|
+
|
|
116
|
+
return () => {
|
|
117
|
+
cancelled = true;
|
|
118
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
119
|
+
document.removeEventListener("visibilitychange", handleVisibility);
|
|
120
|
+
};
|
|
96
121
|
}, []); // runs once
|
|
97
122
|
|
|
98
123
|
// ── Fetch logs when selection changes ──
|