@rebasepro/studio 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -109
- package/dist/{ApiExplorer-DHVmWYfK.js → ApiExplorer-BmcdhAX0.js} +3 -4
- package/dist/ApiExplorer-BmcdhAX0.js.map +1 -0
- package/dist/{AuthSimulationSelector-CM488Eei.js → AuthSimulationSelector-DGoXkWSg.js} +2 -3
- package/dist/AuthSimulationSelector-DGoXkWSg.js.map +1 -0
- package/dist/{BranchesView-DcHZtvXo.js → BranchesView-BiTEwIhd.js} +2 -3
- package/dist/BranchesView-BiTEwIhd.js.map +1 -0
- package/dist/{CronJobsView-CijCToeK.js → CronJobsView-CNfz0etw.js} +2 -3
- package/dist/CronJobsView-CNfz0etw.js.map +1 -0
- package/dist/{JSEditor-CSHA0t_O.js → JSEditor-Ch8z8lJ4.js} +4 -5
- package/dist/JSEditor-Ch8z8lJ4.js.map +1 -0
- package/dist/{RLSEditor-BzDjqo6w.js → RLSEditor-CHEExeSB.js} +2 -3
- package/dist/RLSEditor-CHEExeSB.js.map +1 -0
- package/dist/{SQLEditor-Cr9Kg_Qg.js → SQLEditor-BELYJQRP.js} +75 -58
- package/dist/SQLEditor-BELYJQRP.js.map +1 -0
- package/dist/{StorageView-BYoslzBR.js → StorageView-B7AsN2qX.js} +2 -3
- package/dist/StorageView-B7AsN2qX.js.map +1 -0
- package/dist/common/src/util/entities.d.ts +2 -2
- package/dist/common/src/util/relations.d.ts +1 -1
- package/dist/core/src/components/LoginView/LoginView.d.ts +1 -6
- package/dist/core/src/contexts/SnackbarProvider.d.ts +1 -1
- package/dist/core/src/hooks/data/save.d.ts +2 -2
- package/dist/core/src/hooks/data/useEntityFetch.d.ts +5 -0
- package/dist/core/src/hooks/useResolvedComponent.d.ts +1 -1
- package/dist/index.es.js +8 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +168 -150
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/controllers/auth.d.ts +9 -8
- package/dist/types/src/controllers/client.d.ts +3 -0
- package/dist/types/src/types/auth_adapter.d.ts +356 -0
- package/dist/types/src/types/collections.d.ts +67 -2
- package/dist/types/src/types/database_adapter.d.ts +94 -0
- package/dist/types/src/types/entity_actions.d.ts +7 -1
- package/dist/types/src/types/entity_callbacks.d.ts +1 -1
- package/dist/types/src/types/entity_views.d.ts +36 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/plugins.d.ts +1 -1
- package/dist/types/src/types/properties.d.ts +24 -5
- package/dist/types/src/types/property_config.d.ts +6 -2
- package/dist/types/src/types/relations.d.ts +1 -1
- package/dist/types/src/types/translations.d.ts +8 -0
- package/dist/types/src/users/user.d.ts +5 -0
- package/dist/ui/src/components/FilterChip.d.ts +42 -0
- package/dist/ui/src/components/index.d.ts +5 -0
- package/dist/ui/src/icons/index.d.ts +2 -0
- package/package.json +21 -18
- package/src/components/ApiExplorer/ApiExplorer.tsx +1 -1
- package/src/components/ApiExplorer/EndpointDetail.tsx +10 -2
- package/src/components/ApiExplorer/TryItPanel.tsx +17 -6
- package/src/components/AuthSimulationSelector.tsx +1 -2
- package/src/components/Branches/BranchesView.tsx +24 -2
- package/src/components/CronJobs/CronJobsView.tsx +19 -2
- package/src/components/JSEditor/JSEditor.tsx +37 -6
- package/src/components/JSEditor/JSEditorSidebar.tsx +12 -2
- package/src/components/JSEditor/JSMonacoEditor.tsx +16 -3
- package/src/components/RLSEditor/PolicyEditor.tsx +19 -2
- package/src/components/RLSEditor/RLSEditor.tsx +22 -2
- package/src/components/SQLEditor/SQLEditor.tsx +124 -68
- package/src/components/SQLEditor/SQLEditorSidebar.tsx +1 -2
- package/src/components/SQLEditor/SchemaBrowser.tsx +14 -2
- package/src/components/StorageView/StorageView.tsx +39 -2
- package/src/components/StudioHomePage.tsx +1 -2
- package/src/utils/sql_utils.ts +1 -1
- package/dist/ApiExplorer-DHVmWYfK.js.map +0 -1
- package/dist/AuthSimulationSelector-CM488Eei.js.map +0 -1
- package/dist/BranchesView-DcHZtvXo.js.map +0 -1
- package/dist/CronJobsView-CijCToeK.js.map +0 -1
- package/dist/JSEditor-CSHA0t_O.js.map +0 -1
- package/dist/RLSEditor-BzDjqo6w.js.map +0 -1
- package/dist/SQLEditor-Cr9Kg_Qg.js.map +0 -1
- package/dist/StorageView-BYoslzBR.js.map +0 -1
|
@@ -250,7 +250,7 @@ export interface PluginFormActionProps<USER extends User = User, EC extends Enti
|
|
|
250
250
|
disabled: boolean;
|
|
251
251
|
formContext?: FormContext;
|
|
252
252
|
context: RebaseContext<USER>;
|
|
253
|
-
openEntityMode: "side_panel" | "full_screen" | "split";
|
|
253
|
+
openEntityMode: "side_panel" | "full_screen" | "split" | "dialog";
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
256
|
* Parameters passed to the field builder wrap function.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentRef } from "./component_ref";
|
|
2
|
-
import type { EntityReference, EntityRelation, EntityValues, GeoPoint, Entity } from "./entities";
|
|
2
|
+
import type { EntityReference, EntityRelation, EntityValues, GeoPoint, Entity, Vector } from "./entities";
|
|
3
3
|
import type { Relation, JoinStep, OnAction } from "./relations";
|
|
4
4
|
import type { EntityCollection, FilterValues } from "./collections";
|
|
5
5
|
import type { ColorKey, ColorScheme } from "./chips";
|
|
@@ -31,8 +31,8 @@ export type PropertyCallbacks<T = unknown, M extends Record<string, unknown> = R
|
|
|
31
31
|
/**
|
|
32
32
|
* @group Entity properties
|
|
33
33
|
*/
|
|
34
|
-
export type DataType = "string" | "number" | "boolean" | "date" | "geopoint" | "reference" | "relation" | "array" | "map";
|
|
35
|
-
export type Property = StringProperty | NumberProperty | BooleanProperty | DateProperty | GeopointProperty | ReferenceProperty | RelationProperty | ArrayProperty | MapProperty;
|
|
34
|
+
export type DataType = "string" | "number" | "boolean" | "date" | "geopoint" | "reference" | "relation" | "array" | "map" | "vector" | "binary";
|
|
35
|
+
export type Property = StringProperty | NumberProperty | BooleanProperty | DateProperty | GeopointProperty | ReferenceProperty | RelationProperty | ArrayProperty | MapProperty | VectorProperty | BinaryProperty;
|
|
36
36
|
export type Properties = {
|
|
37
37
|
[key: string]: Property;
|
|
38
38
|
};
|
|
@@ -48,7 +48,7 @@ export type FirebaseProperties = {
|
|
|
48
48
|
* A helper type to infer the underlying data type from a Property definition.
|
|
49
49
|
* This is the core of the type inference system.
|
|
50
50
|
*/
|
|
51
|
-
export type InferPropertyType<P extends Property> = P extends StringProperty ? string : P extends NumberProperty ? number : P extends BooleanProperty ? boolean : P extends DateProperty ? Date : P extends GeopointProperty ? GeoPoint : P extends ReferenceProperty ? EntityReference : P extends RelationProperty ? EntityRelation | EntityRelation[] : P extends ArrayProperty ? (P["of"] extends Property ? InferPropertyType<P["of"]>[] : unknown[]) : P extends MapProperty ? (P["properties"] extends Properties ? InferEntityType<P["properties"]> : Record<string, unknown>) : never;
|
|
51
|
+
export type InferPropertyType<P extends Property> = P extends StringProperty ? string : P extends NumberProperty ? number : P extends BooleanProperty ? boolean : P extends DateProperty ? Date : P extends GeopointProperty ? GeoPoint : P extends ReferenceProperty ? EntityReference : P extends RelationProperty ? EntityRelation | EntityRelation[] : P extends ArrayProperty ? (P["of"] extends Property ? InferPropertyType<P["of"]>[] : unknown[]) : P extends MapProperty ? (P["properties"] extends Properties ? InferEntityType<P["properties"]> : Record<string, unknown>) : P extends VectorProperty ? Vector : P extends BinaryProperty ? string : never;
|
|
52
52
|
/**
|
|
53
53
|
* Helper type that determines whether a property is required.
|
|
54
54
|
* Uses direct structural matching against `{ validation: { required: true } }`
|
|
@@ -309,6 +309,25 @@ export interface BooleanProperty extends BaseProperty {
|
|
|
309
309
|
*/
|
|
310
310
|
validation?: PropertyValidationSchema;
|
|
311
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* @group Entity properties
|
|
314
|
+
*/
|
|
315
|
+
export interface VectorUIConfig extends BaseUIConfig {
|
|
316
|
+
clearable?: boolean;
|
|
317
|
+
}
|
|
318
|
+
export interface VectorProperty extends BaseProperty {
|
|
319
|
+
ui?: VectorUIConfig;
|
|
320
|
+
type: "vector";
|
|
321
|
+
dimensions: number;
|
|
322
|
+
validation?: PropertyValidationSchema;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* @group Entity properties
|
|
326
|
+
*/
|
|
327
|
+
export interface BinaryProperty extends BaseProperty {
|
|
328
|
+
type: "binary";
|
|
329
|
+
validation?: PropertyValidationSchema;
|
|
330
|
+
}
|
|
312
331
|
/**
|
|
313
332
|
* @group Entity properties
|
|
314
333
|
*/
|
|
@@ -421,7 +440,7 @@ export interface RelationProperty extends BaseProperty {
|
|
|
421
440
|
* When set, the framework treats this property as a self-contained relation
|
|
422
441
|
* definition and no separate `relations[]` entry is needed.
|
|
423
442
|
*/
|
|
424
|
-
target?: () => EntityCollection;
|
|
443
|
+
target?: string | (() => EntityCollection | string);
|
|
425
444
|
/**
|
|
426
445
|
* Whether this property references one or many records.
|
|
427
446
|
* Defaults to `"one"`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ArrayProperty, MapProperty, StringProperty, NumberProperty, BooleanProperty, DateProperty, GeopointProperty, ReferenceProperty, RelationProperty } from "./properties";
|
|
2
|
+
import { ArrayProperty, MapProperty, StringProperty, NumberProperty, BooleanProperty, DateProperty, GeopointProperty, ReferenceProperty, RelationProperty, VectorProperty, BinaryProperty } from "./properties";
|
|
3
3
|
import { BaseProperty } from "./properties";
|
|
4
4
|
type CMSBasePropertyNoName = Omit<BaseProperty, "name">;
|
|
5
5
|
export type ConfigProperty = (Omit<StringProperty, "name"> & {
|
|
@@ -28,6 +28,10 @@ export type ConfigProperty = (Omit<StringProperty, "name"> & {
|
|
|
28
28
|
} & CMSBasePropertyNoName) | (Omit<MapProperty, "name" | "properties"> & {
|
|
29
29
|
name?: string;
|
|
30
30
|
properties?: Record<string, ConfigProperty>;
|
|
31
|
+
} & CMSBasePropertyNoName) | (Omit<VectorProperty, "name"> & {
|
|
32
|
+
name?: string;
|
|
33
|
+
} & CMSBasePropertyNoName) | (Omit<BinaryProperty, "name"> & {
|
|
34
|
+
name?: string;
|
|
31
35
|
} & CMSBasePropertyNoName);
|
|
32
36
|
/**
|
|
33
37
|
* This is the configuration object for a property.
|
|
@@ -66,5 +70,5 @@ export type PropertyConfig = {
|
|
|
66
70
|
*/
|
|
67
71
|
description?: string;
|
|
68
72
|
};
|
|
69
|
-
export type PropertyConfigId = "text_field" | "multiline" | "markdown" | "url" | "email" | "user_select" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference" | "reference_as_string" | "multi_references" | "relation" | "switch" | "date_time" | "repeat" | "custom_array" | "block";
|
|
73
|
+
export type PropertyConfigId = "text_field" | "multiline" | "markdown" | "url" | "email" | "user_select" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference" | "reference_as_string" | "multi_references" | "relation" | "switch" | "date_time" | "repeat" | "custom_array" | "block" | "vector_input";
|
|
70
74
|
export {};
|
|
@@ -17,7 +17,7 @@ export interface Relation {
|
|
|
17
17
|
/**
|
|
18
18
|
* The final collection you want to retrieve records from.
|
|
19
19
|
*/
|
|
20
|
-
target: () => EntityCollection;
|
|
20
|
+
target: (() => EntityCollection) | any;
|
|
21
21
|
/**
|
|
22
22
|
* The nature of the relationship, determining if one or many records are returned.
|
|
23
23
|
*/
|
|
@@ -30,6 +30,8 @@ export interface RebaseTranslations {
|
|
|
30
30
|
copy: string;
|
|
31
31
|
delete: string;
|
|
32
32
|
delete_not_allowed: string;
|
|
33
|
+
edit_entity?: string;
|
|
34
|
+
back_to_detail?: string;
|
|
33
35
|
delete_confirmation_title: string;
|
|
34
36
|
delete_confirmation_body: string;
|
|
35
37
|
delete_multiple_confirmation_body: string;
|
|
@@ -392,6 +394,12 @@ export interface RebaseTranslations {
|
|
|
392
394
|
submit: string;
|
|
393
395
|
no_filterable_properties: string;
|
|
394
396
|
apply_filters: string;
|
|
397
|
+
/** Label shown on the filter presets dropdown trigger */
|
|
398
|
+
filter_presets?: string;
|
|
399
|
+
/** Tooltip shown when hovering over a preset entry */
|
|
400
|
+
filter_preset_apply?: string;
|
|
401
|
+
/** Shown when a preset is active, with {{label}} interpolation */
|
|
402
|
+
filter_preset_active?: string;
|
|
395
403
|
list: string;
|
|
396
404
|
table_view_mode: string;
|
|
397
405
|
cards: string;
|
|
@@ -42,5 +42,10 @@ export type User = {
|
|
|
42
42
|
* The date and time when the user was created.
|
|
43
43
|
*/
|
|
44
44
|
createdAt?: Date | string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Additional metadata/custom claims associated with the user.
|
|
47
|
+
* Accessible by the frontend, but only writable by the backend.
|
|
48
|
+
*/
|
|
49
|
+
readonly metadata?: Record<string, any>;
|
|
45
50
|
getIdToken?: (forceRefresh?: boolean) => Promise<string>;
|
|
46
51
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FilterChipProps {
|
|
3
|
+
/**
|
|
4
|
+
* The text label displayed on the chip.
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the chip is currently in an active/selected state.
|
|
9
|
+
*/
|
|
10
|
+
active?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Callback when the chip is clicked.
|
|
13
|
+
*/
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Optional icon rendered before the label.
|
|
17
|
+
*/
|
|
18
|
+
icon?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Size variant.
|
|
21
|
+
* @default "medium"
|
|
22
|
+
*/
|
|
23
|
+
size?: "small" | "medium";
|
|
24
|
+
/**
|
|
25
|
+
* Additional class names.
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the chip is disabled.
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A toggle chip used for filter presets and similar multi-select controls.
|
|
35
|
+
*
|
|
36
|
+
* Uses an inset box-shadow for the active ring instead of `border` so the
|
|
37
|
+
* chip size stays stable across states and the ring cannot be clipped by
|
|
38
|
+
* parent `overflow-hidden` containers.
|
|
39
|
+
*
|
|
40
|
+
* @group Interactive components
|
|
41
|
+
*/
|
|
42
|
+
export declare function FilterChip({ children, active, onClick, icon, size, className, disabled }: FilterChipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,6 +22,7 @@ export * from "./DialogContent";
|
|
|
22
22
|
export * from "./DialogTitle";
|
|
23
23
|
export * from "./ExpandablePanel";
|
|
24
24
|
export * from "./FileUpload";
|
|
25
|
+
export * from "./FilterChip";
|
|
25
26
|
export * from "./IconButton";
|
|
26
27
|
export * from "./InputLabel";
|
|
27
28
|
export * from "./InfoLabel";
|
|
@@ -51,3 +52,7 @@ export * from "./DebouncedTextField";
|
|
|
51
52
|
export * from "./Skeleton";
|
|
52
53
|
export * from "./ToggleButtonGroup";
|
|
53
54
|
export * from "./VirtualTable";
|
|
55
|
+
import * as Portal from "@radix-ui/react-portal";
|
|
56
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
57
|
+
export { Portal, PopoverPrimitive };
|
|
58
|
+
export { Slot } from "@radix-ui/react-slot";
|
|
@@ -4,3 +4,5 @@ export * from "./Icon";
|
|
|
4
4
|
export * from "./GitHubIcon";
|
|
5
5
|
export * from "./HandleIcon";
|
|
6
6
|
export type { LucideProps, LucideIcon } from "lucide-react";
|
|
7
|
+
export { icons as lucideIcons } from "lucide-react";
|
|
8
|
+
export { AlertCircleIcon, AlertTriangleIcon, AlignLeftIcon, AppWindow, ArrowDownToLineIcon, ArrowLeftIcon, ArrowRightFromLineIcon, ArrowRightIcon, ArrowRightToLineIcon, ArrowUpToLineIcon, BoldIcon, BookOpenIcon, CalendarIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleIcon, CircleUserIcon, CodeIcon, ColumnsIcon, CopyIcon, DatabaseIcon, DownloadIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileIcon, FileSearchIcon, FileTextIcon, FilterIcon, FilterXIcon, FlagIcon, FolderIcon, FolderPlusIcon, FolderUpIcon, FunctionSquareIcon, GitBranchIcon, GlobeIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HistoryIcon, HomeIcon, ImageIcon, ImageOffIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyIcon, KeyRoundIcon, LanguagesIcon, LayoutGridIcon, LinkIcon, ListIcon, ListOrderedIcon, LoaderIcon, LogOutIcon, MailIcon, Maximize2Icon, MenuIcon, MinusCircleIcon, MinusIcon, MoonIcon, MoreVerticalIcon, Music2Icon, PanelLeftIcon, PauseIcon, PencilIcon, PhoneIcon, PlayIcon, PlusIcon, QuoteIcon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, Rows3Icon, SaveIcon, SearchIcon, SendIcon, SettingsIcon, ShieldIcon, ShoppingCartIcon, SlidersHorizontalIcon, SquareIcon, StarIcon, StrikethroughIcon, SunIcon, SunMoonIcon, TableIcon, TagIcon, TerminalIcon, TextIcon, Trash2Icon, TypeIcon, UnderlineIcon, UndoIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, VideoIcon, VoteIcon, Wand2Icon, XCircleIcon, XIcon, } from "lucide-react";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/studio",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"types": "dist/studio/src/index.d.ts",
|
|
@@ -11,21 +11,23 @@
|
|
|
11
11
|
"@types/dagre": "0.7.54",
|
|
12
12
|
"@xyflow/react": "12.10.2",
|
|
13
13
|
"dagre": "0.8.5",
|
|
14
|
+
"monaco-editor": "^0.55.1",
|
|
14
15
|
"pgsql-ast-parser": "12.0.2",
|
|
15
16
|
"prism-react-renderer": "^2.4.1",
|
|
16
|
-
"
|
|
17
|
-
"@rebasepro/common": "0.1
|
|
18
|
-
"@rebasepro/core": "0.1
|
|
19
|
-
"@rebasepro/types": "0.1
|
|
20
|
-
"@rebasepro/utils": "0.1
|
|
21
|
-
"@rebasepro/ui": "0.1
|
|
17
|
+
"react-dropzone": "^14.4.1",
|
|
18
|
+
"@rebasepro/common": "0.2.1",
|
|
19
|
+
"@rebasepro/core": "0.2.1",
|
|
20
|
+
"@rebasepro/types": "0.2.1",
|
|
21
|
+
"@rebasepro/utils": "0.2.1",
|
|
22
|
+
"@rebasepro/ui": "0.2.1",
|
|
23
|
+
"@rebasepro/client": "0.2.1"
|
|
22
24
|
},
|
|
23
25
|
"peerDependencies": {
|
|
24
26
|
"react": ">=19.0.0",
|
|
25
27
|
"react-dom": ">=19.0.0",
|
|
26
28
|
"react-router": "^7.0.0",
|
|
27
29
|
"react-router-dom": "^7.0.0",
|
|
28
|
-
"@rebasepro/admin": "0.1
|
|
30
|
+
"@rebasepro/admin": "0.2.1"
|
|
29
31
|
},
|
|
30
32
|
"peerDependenciesMeta": {
|
|
31
33
|
"@rebasepro/admin": {
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
"exports": {
|
|
36
38
|
".": {
|
|
37
39
|
"types": "./dist/studio/src/index.d.ts",
|
|
38
|
-
"development": "./
|
|
40
|
+
"development": "./dist/index.es.js",
|
|
39
41
|
"import": "./dist/index.es.js",
|
|
40
42
|
"require": "./dist/index.umd.js"
|
|
41
43
|
},
|
|
@@ -54,18 +56,19 @@
|
|
|
54
56
|
]
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
57
|
-
"@jest/globals": "^30.
|
|
58
|
-
"@types/
|
|
59
|
-
"@types/
|
|
59
|
+
"@jest/globals": "^30.4.1",
|
|
60
|
+
"@types/jest": "^29.5.14",
|
|
61
|
+
"@types/node": "^20.19.41",
|
|
62
|
+
"@types/react": "^19.2.15",
|
|
63
|
+
"@types/react-dom": "^19.2.3",
|
|
60
64
|
"@vitejs/plugin-react": "^4.7.0",
|
|
61
|
-
"babel-plugin-react-compiler": "
|
|
62
|
-
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
65
|
+
"babel-plugin-react-compiler": "19.0.0-beta-ebf51a3-20250411",
|
|
63
66
|
"jest": "^29.7.0",
|
|
64
|
-
"react-router": "^7.
|
|
65
|
-
"react-router-dom": "^7.
|
|
66
|
-
"ts-jest": "^29.4.
|
|
67
|
+
"react-router": "^7.15.1",
|
|
68
|
+
"react-router-dom": "^7.15.1",
|
|
69
|
+
"ts-jest": "^29.4.10",
|
|
67
70
|
"typescript": "^5.9.3",
|
|
68
|
-
"vite": "^7.
|
|
71
|
+
"vite": "^7.3.3"
|
|
69
72
|
},
|
|
70
73
|
"files": [
|
|
71
74
|
"dist",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
SearchBar,
|
|
12
12
|
iconSize
|
|
13
13
|
} from "@rebasepro/ui";
|
|
14
|
-
import { BookOpenIcon, PlayIcon } from "
|
|
14
|
+
import { BookOpenIcon, PlayIcon } from "@rebasepro/ui";
|
|
15
15
|
import { EndpointDetail } from "./EndpointDetail";
|
|
16
16
|
import { TryItPanel } from "./TryItPanel";
|
|
17
17
|
import type { OpenApiSpec, ParsedEndpoint } from "./types";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
ArrowRightFromLineIcon,
|
|
4
|
+
Chip,
|
|
5
|
+
cls,
|
|
6
|
+
defaultBorderMixin,
|
|
7
|
+
iconSize,
|
|
8
|
+
SlidersHorizontalIcon,
|
|
9
|
+
Typography,
|
|
10
|
+
UploadIcon
|
|
11
|
+
} from "@rebasepro/ui";
|
|
4
12
|
import type { ParsedEndpoint, OpenApiSpec, OpenApiSchema } from "./types";
|
|
5
13
|
import { resolveRef, resolveRefName } from "./parseSpec";
|
|
6
14
|
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React, { useState, useCallback, useMemo, useEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
cls,
|
|
5
|
+
defaultBorderMixin,
|
|
6
|
+
IconButton,
|
|
7
|
+
iconSize,
|
|
8
|
+
LoaderIcon,
|
|
9
|
+
PlusIcon,
|
|
10
|
+
SendIcon,
|
|
11
|
+
TextField,
|
|
12
|
+
Typography,
|
|
13
|
+
XIcon
|
|
14
|
+
} from "@rebasepro/ui";
|
|
4
15
|
import { useRebaseContext, UserSelectPopover, SelectableUser } from "@rebasepro/core";
|
|
5
16
|
import { AuthSimulationSelector } from "../AuthSimulationSelector";
|
|
6
17
|
import type { ParsedEndpoint } from "./types";
|
|
@@ -22,19 +33,19 @@ export function TryItPanel({ endpoint, apiUrl, getAuthToken, user, basePath = ""
|
|
|
22
33
|
const storageKey = `rebase_apiexplorer_${endpoint.method}_${endpoint.path}`;
|
|
23
34
|
|
|
24
35
|
const [pathParams, setPathParams] = useState<Record<string, string>>(() => {
|
|
25
|
-
try { const v = localStorage.getItem(`${storageKey}_path`); if (v) return JSON.parse(v); } catch {}
|
|
36
|
+
try { const v = localStorage.getItem(`${storageKey}_path`); if (v) return JSON.parse(v); } catch { /* ignore */ }
|
|
26
37
|
return {};
|
|
27
38
|
});
|
|
28
39
|
const [queryParams, setQueryParams] = useState<Record<string, string>>(() => {
|
|
29
|
-
try { const v = localStorage.getItem(`${storageKey}_query`); if (v) return JSON.parse(v); } catch {}
|
|
40
|
+
try { const v = localStorage.getItem(`${storageKey}_query`); if (v) return JSON.parse(v); } catch { /* ignore */ }
|
|
30
41
|
return {};
|
|
31
42
|
});
|
|
32
43
|
const [customHeaders, setCustomHeaders] = useState<Array<{ key: string; value: string }>>(() => {
|
|
33
|
-
try { const v = localStorage.getItem(`${storageKey}_headers`); if (v) return JSON.parse(v); } catch {}
|
|
44
|
+
try { const v = localStorage.getItem(`${storageKey}_headers`); if (v) return JSON.parse(v); } catch { /* ignore */ }
|
|
34
45
|
return [{ key: "rebase-branch", value: "" }];
|
|
35
46
|
});
|
|
36
47
|
const [body, setBody] = useState(() => {
|
|
37
|
-
try { const v = localStorage.getItem(`${storageKey}_body`); if (v) return JSON.parse(v); } catch {}
|
|
48
|
+
try { const v = localStorage.getItem(`${storageKey}_body`); if (v) return JSON.parse(v); } catch { /* ignore */ }
|
|
38
49
|
return buildBodyTemplate(endpoint);
|
|
39
50
|
});
|
|
40
51
|
const [response, setResponse] = useState<{ status: number; statusText: string; body: string; time: number } | null>(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { KeyRoundIcon } from "lucide-react";
|
|
2
|
+
import { Button, cls, iconSize, KeyRoundIcon, Typography } from "@rebasepro/ui";
|
|
4
3
|
import { UserSelectPopover, SelectableUser } from "@rebasepro/core";
|
|
5
4
|
|
|
6
5
|
export interface AuthSimulationSelectorProps {
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
Button,
|
|
6
|
+
Chip,
|
|
7
|
+
CircularProgress,
|
|
8
|
+
cls,
|
|
9
|
+
CopyIcon,
|
|
10
|
+
defaultBorderMixin,
|
|
11
|
+
Dialog,
|
|
12
|
+
DialogActions,
|
|
13
|
+
DialogContent,
|
|
14
|
+
DialogTitle,
|
|
15
|
+
GitBranchIcon,
|
|
16
|
+
IconButton,
|
|
17
|
+
iconSize,
|
|
18
|
+
Paper,
|
|
19
|
+
PlusIcon,
|
|
20
|
+
RefreshCwIcon,
|
|
21
|
+
Select,
|
|
22
|
+
SelectItem,
|
|
23
|
+
TextField,
|
|
24
|
+
Trash2Icon,
|
|
25
|
+
Typography
|
|
26
|
+
} from "@rebasepro/ui";
|
|
5
27
|
import { useRebaseContext, useSnackbarController, ConfirmationDialog } from "@rebasepro/core";
|
|
6
28
|
import { isBranchAdmin } from "@rebasepro/types";
|
|
7
29
|
import type { BranchInfo } from "@rebasepro/types";
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { useState, useEffect, useRef } from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
AlertCircleIcon,
|
|
5
|
+
Button,
|
|
6
|
+
CalendarIcon,
|
|
7
|
+
Card,
|
|
8
|
+
CheckCircleIcon,
|
|
9
|
+
Chip,
|
|
10
|
+
CircularProgress,
|
|
11
|
+
cls,
|
|
12
|
+
defaultBorderMixin,
|
|
13
|
+
HistoryIcon,
|
|
14
|
+
IconButton,
|
|
15
|
+
iconSize,
|
|
16
|
+
Paper,
|
|
17
|
+
PauseIcon,
|
|
18
|
+
PlayIcon,
|
|
19
|
+
RefreshCwIcon,
|
|
20
|
+
Typography
|
|
21
|
+
} from "@rebasepro/ui";
|
|
5
22
|
import { useRebaseClient, useSnackbarController } from "@rebasepro/core";
|
|
6
23
|
import type { CronJobStatus, CronJobLogEntry } from "@rebasepro/types";
|
|
7
24
|
import type { RebaseClient } from "@rebasepro/client";
|
|
@@ -2,8 +2,39 @@
|
|
|
2
2
|
import React, { useState, useEffect, useCallback, useRef, useMemo } from "react";
|
|
3
3
|
import { Highlight, themes } from "prism-react-renderer";
|
|
4
4
|
import { toSnakeCase } from "@rebasepro/utils";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
Button,
|
|
7
|
+
CellRendererParams,
|
|
8
|
+
Chip,
|
|
9
|
+
CircularProgress,
|
|
10
|
+
cls,
|
|
11
|
+
defaultBorderMixin,
|
|
12
|
+
Dialog,
|
|
13
|
+
DialogActions,
|
|
14
|
+
DialogContent,
|
|
15
|
+
DialogTitle,
|
|
16
|
+
DownloadIcon,
|
|
17
|
+
IconButton,
|
|
18
|
+
iconSize,
|
|
19
|
+
Menu,
|
|
20
|
+
MenuIcon,
|
|
21
|
+
MenuItem,
|
|
22
|
+
MoreVerticalIcon,
|
|
23
|
+
PencilIcon,
|
|
24
|
+
PlayIcon,
|
|
25
|
+
PlusIcon,
|
|
26
|
+
ResizablePanels,
|
|
27
|
+
SaveIcon,
|
|
28
|
+
Tab,
|
|
29
|
+
Tabs,
|
|
30
|
+
TerminalIcon,
|
|
31
|
+
TextField,
|
|
32
|
+
Tooltip,
|
|
33
|
+
Typography,
|
|
34
|
+
VirtualTable,
|
|
35
|
+
VirtualTableColumn,
|
|
36
|
+
XIcon
|
|
37
|
+
} from "@rebasepro/ui";
|
|
7
38
|
import { useStudioUrlController, useStudioCollectionRegistry, useStudioSideEntityController } from "@rebasepro/core";
|
|
8
39
|
import { useRebaseContext, useRebaseClient, useSnackbarController, useApiConfig, useTranslation, useModeController, ErrorView, SelectableUser, IconForView } from "@rebasepro/core";
|
|
9
40
|
import { EntityCollection } from "@rebasepro/types";
|
|
@@ -134,7 +165,7 @@ function detectCollectionsInResult(
|
|
|
134
165
|
for (const slug of mentionedSlugs) {
|
|
135
166
|
const normalised = toSnakeCase(slug);
|
|
136
167
|
const col = collections.find(c => {
|
|
137
|
-
const tableName = (c as
|
|
168
|
+
const tableName = (c as EntityCollection & { table?: string }).table || toSnakeCase(c.slug);
|
|
138
169
|
return c.slug === slug || tableName === normalised || toSnakeCase(c.slug) === normalised;
|
|
139
170
|
});
|
|
140
171
|
if (col) {
|
|
@@ -364,7 +395,7 @@ isScoped: true };
|
|
|
364
395
|
|
|
365
396
|
const consoleEntries: ConsoleEntry[] = [];
|
|
366
397
|
const startTime = performance.now();
|
|
367
|
-
let scopedClientToCleanUp:
|
|
398
|
+
let scopedClientToCleanUp: { ws?: { disconnect(): void } } | null = null;
|
|
368
399
|
|
|
369
400
|
// Capture console methods
|
|
370
401
|
const originalConsole = {
|
|
@@ -427,13 +458,13 @@ timestamp: Date.now() });
|
|
|
427
458
|
} else {
|
|
428
459
|
setResultView("json");
|
|
429
460
|
}
|
|
430
|
-
} catch (err:
|
|
461
|
+
} catch (err: unknown) {
|
|
431
462
|
const duration = performance.now() - startTime;
|
|
432
463
|
setResult({
|
|
433
464
|
value: undefined,
|
|
434
465
|
console: consoleEntries,
|
|
435
466
|
duration,
|
|
436
|
-
error: err
|
|
467
|
+
error: err instanceof Error ? err.message : String(err),
|
|
437
468
|
timestamp: Date.now()
|
|
438
469
|
});
|
|
439
470
|
setResultView("json");
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
cls,
|
|
5
|
+
defaultBorderMixin,
|
|
6
|
+
IconButton,
|
|
7
|
+
iconSize,
|
|
8
|
+
PlusIcon,
|
|
9
|
+
Tab,
|
|
10
|
+
Tabs,
|
|
11
|
+
Tooltip,
|
|
12
|
+
Trash2Icon,
|
|
13
|
+
Typography
|
|
14
|
+
} from "@rebasepro/ui";
|
|
5
15
|
|
|
6
16
|
export interface JSSnippet {
|
|
7
17
|
id: string;
|
|
@@ -2,10 +2,23 @@
|
|
|
2
2
|
import React, { useRef, useEffect } from "react";
|
|
3
3
|
import Editor, { Monaco, OnMount } from "@monaco-editor/react";
|
|
4
4
|
import type { editor } from "monaco-editor";
|
|
5
|
-
import { cls, defaultBorderMixin } from "@rebasepro/ui";
|
|
6
|
-
import { FileIcon } from "lucide-react";
|
|
5
|
+
import { cls, defaultBorderMixin, FileIcon } from "@rebasepro/ui";
|
|
7
6
|
import { useModeController } from "@rebasepro/core";
|
|
8
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Shape of `monaco.languages.typescript` at runtime.
|
|
10
|
+
* The bundled type stubs mark this API as deprecated, but it is fully functional.
|
|
11
|
+
*/
|
|
12
|
+
interface MonacoTypeScriptApi {
|
|
13
|
+
typescriptDefaults: {
|
|
14
|
+
setCompilerOptions(options: Record<string, unknown>): void;
|
|
15
|
+
setDiagnosticsOptions(options: Record<string, unknown>): void;
|
|
16
|
+
addExtraLib(content: string, filePath: string): void;
|
|
17
|
+
};
|
|
18
|
+
ScriptTarget: Record<string, number>;
|
|
19
|
+
ModuleKind: Record<string, number>;
|
|
20
|
+
}
|
|
21
|
+
|
|
9
22
|
/** Ambient type definitions for the Rebase client SDK injected into Monaco. */
|
|
10
23
|
const REBASE_CLIENT_TYPES = `
|
|
11
24
|
// ─── Rebase Client SDK Type Definitions ─────────────────────────────
|
|
@@ -303,7 +316,7 @@ export const JSMonacoEditor = ({
|
|
|
303
316
|
// Note: cast through `any` because the bundled type stubs mark
|
|
304
317
|
// `monaco.languages.typescript` as deprecated while the runtime
|
|
305
318
|
// API is fully functional.
|
|
306
|
-
const ts = (monaco.languages as
|
|
319
|
+
const ts = (monaco.languages as unknown as { typescript: MonacoTypeScriptApi }).typescript;
|
|
307
320
|
ts.typescriptDefaults.setCompilerOptions({
|
|
308
321
|
target: ts.ScriptTarget.ESNext,
|
|
309
322
|
module: ts.ModuleKind.ESNext,
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
cls,
|
|
6
|
+
defaultBorderMixin,
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogActions,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
HelpCircleIcon,
|
|
12
|
+
IconButton,
|
|
13
|
+
iconSize,
|
|
14
|
+
MultiSelect,
|
|
15
|
+
MultiSelectItem,
|
|
16
|
+
Paper,
|
|
17
|
+
Select,
|
|
18
|
+
SelectItem,
|
|
19
|
+
TextField,
|
|
20
|
+
Typography
|
|
21
|
+
} from "@rebasepro/ui";
|
|
5
22
|
import { useTranslation } from "@rebasepro/core";
|
|
6
23
|
import { MonacoEditor } from "../SQLEditor/MonacoEditor";
|
|
7
24
|
import { PostgresPolicy } from "./RLSEditor";
|
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
|
|
2
2
|
import { useStudioCollectionRegistry } from "@rebasepro/core";
|
|
3
3
|
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
Alert,
|
|
6
|
+
AlertTriangleIcon,
|
|
7
|
+
Button,
|
|
8
|
+
Card,
|
|
9
|
+
Chip,
|
|
10
|
+
CircularProgress,
|
|
11
|
+
cls,
|
|
12
|
+
defaultBorderMixin,
|
|
13
|
+
IconButton,
|
|
14
|
+
iconSize,
|
|
15
|
+
KeyIcon,
|
|
16
|
+
Paper,
|
|
17
|
+
RefreshCwIcon,
|
|
18
|
+
ResizablePanels,
|
|
19
|
+
ShieldIcon,
|
|
20
|
+
Tab,
|
|
21
|
+
Tabs,
|
|
22
|
+
Tooltip,
|
|
23
|
+
Trash2Icon,
|
|
24
|
+
Typography
|
|
25
|
+
} from "@rebasepro/ui";
|
|
6
26
|
import { useRebaseContext, useSnackbarController, ErrorView, useTranslation } from "@rebasepro/core";
|
|
7
27
|
import { isPostgresCollection } from "@rebasepro/types";
|
|
8
28
|
import { PolicyEditor } from "./PolicyEditor";
|