@rebasepro/client-postgresql 0.0.1-canary.dbf160a → 0.0.1-canary.e17585f

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.
@@ -0,0 +1,187 @@
1
+ import type { AdminUser, AdminRole } from "../controllers/client";
2
+ /**
3
+ * Context passed to every backend hook.
4
+ * Provides information about the request that triggered the hook.
5
+ * @group Backend Hooks
6
+ */
7
+ export interface BackendHookContext {
8
+ /** The currently authenticated user making the request (if any) */
9
+ requestUser?: {
10
+ userId: string;
11
+ roles: string[];
12
+ };
13
+ /** The HTTP method of the request */
14
+ method: "GET" | "POST" | "PUT" | "DELETE";
15
+ }
16
+ /**
17
+ * Hooks for intercepting Admin User data at the API boundary.
18
+ *
19
+ * These hooks run on the server after the database operation completes
20
+ * but before the response is sent to the client.
21
+ *
22
+ * @group Backend Hooks
23
+ */
24
+ export interface UserHooks {
25
+ /**
26
+ * Transform a user record after it's read from the database,
27
+ * before it's returned to the client.
28
+ *
29
+ * Return the modified user, or `null` to filter it out entirely
30
+ * (the user won't appear in listings or individual fetches).
31
+ */
32
+ afterRead?(user: AdminUser, context: BackendHookContext): AdminUser | null | Promise<AdminUser | null>;
33
+ /**
34
+ * Transform user data before it's written to the database.
35
+ * Runs on POST (create) and PUT (update).
36
+ *
37
+ * Return the (possibly modified) data to proceed with the save.
38
+ * Throw an error to abort the operation.
39
+ */
40
+ beforeSave?(data: {
41
+ email?: string;
42
+ displayName?: string;
43
+ roles?: string[];
44
+ }, context: BackendHookContext): {
45
+ email?: string;
46
+ displayName?: string;
47
+ roles?: string[];
48
+ } | Promise<{
49
+ email?: string;
50
+ displayName?: string;
51
+ roles?: string[];
52
+ }>;
53
+ /**
54
+ * Called after a user is successfully created or updated.
55
+ * Useful for side-effects like sending notifications.
56
+ */
57
+ afterSave?(user: AdminUser, context: BackendHookContext): void | Promise<void>;
58
+ /**
59
+ * Called before a user is deleted. Throw to prevent deletion.
60
+ */
61
+ beforeDelete?(userId: string, context: BackendHookContext): void | Promise<void>;
62
+ /**
63
+ * Called after a user is successfully deleted.
64
+ */
65
+ afterDelete?(userId: string, context: BackendHookContext): void | Promise<void>;
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
+ /**
81
+ * Hooks for intercepting collection entity data at the REST API boundary.
82
+ *
83
+ * These run **after** per-collection `EntityCallbacks` (which execute inside
84
+ * the DataDriver) and provide a single cross-cutting interception point for
85
+ * ALL collections flowing through the REST API.
86
+ *
87
+ * Every callback receives the collection `slug` so you can target specific
88
+ * collections or apply logic globally.
89
+ *
90
+ * @group Backend Hooks
91
+ */
92
+ export interface DataHooks {
93
+ /**
94
+ * Transform an entity after it's read from the database,
95
+ * before it's returned to the client.
96
+ *
97
+ * Runs for both list (GET /:slug) and single (GET /:slug/:id) fetches.
98
+ * Return the modified entity, or `null` to filter it out.
99
+ *
100
+ * @param slug - The collection slug (e.g. "orders", "products")
101
+ * @param entity - The flattened entity object (id + values merged)
102
+ * @param context - Request context (authenticated user, HTTP method)
103
+ */
104
+ afterRead?(slug: string, entity: Record<string, unknown>, context: BackendHookContext): Record<string, unknown> | null | Promise<Record<string, unknown> | null>;
105
+ /**
106
+ * Transform entity values before they are written to the database.
107
+ * Runs on POST (create) and PUT (update).
108
+ *
109
+ * Return the (possibly modified) values. Throw to abort the save.
110
+ *
111
+ * @param slug - The collection slug
112
+ * @param values - The raw request body values
113
+ * @param entityId - The entity ID (only present on updates)
114
+ * @param context - Request context
115
+ */
116
+ beforeSave?(slug: string, values: Record<string, unknown>, entityId: string | undefined, context: BackendHookContext): Record<string, unknown> | Promise<Record<string, unknown>>;
117
+ /**
118
+ * Called after an entity is successfully saved (created or updated).
119
+ * Useful for side-effects like syncing to external systems.
120
+ *
121
+ * @param slug - The collection slug
122
+ * @param entity - The saved entity (flattened)
123
+ * @param context - Request context
124
+ */
125
+ afterSave?(slug: string, entity: Record<string, unknown>, context: BackendHookContext): void | Promise<void>;
126
+ /**
127
+ * Called before an entity is deleted. Throw to prevent deletion.
128
+ *
129
+ * @param slug - The collection slug
130
+ * @param entityId - The entity ID being deleted
131
+ * @param context - Request context
132
+ */
133
+ beforeDelete?(slug: string, entityId: string, context: BackendHookContext): void | Promise<void>;
134
+ /**
135
+ * Called after an entity is successfully deleted.
136
+ *
137
+ * @param slug - The collection slug
138
+ * @param entityId - The deleted entity ID
139
+ * @param context - Request context
140
+ */
141
+ afterDelete?(slug: string, entityId: string, context: BackendHookContext): void | Promise<void>;
142
+ }
143
+ /**
144
+ * Backend-level hooks for intercepting data at the API boundary.
145
+ *
146
+ * These hooks run server-side after database operations complete and before
147
+ * API responses are sent.
148
+ *
149
+ * - `users` / `roles` — intercept admin user and role management endpoints
150
+ * - `data` — intercept ALL collection entity data flowing through the REST API
151
+ *
152
+ * `data` hooks complement per-collection `EntityCallbacks`. Entity callbacks
153
+ * run inside the DataDriver (close to the DB); data hooks run at the HTTP
154
+ * boundary (close to the client). Use data hooks for cross-cutting concerns
155
+ * like audit logging, response enrichment, or field masking.
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * const hooks: BackendHooks = {
160
+ * data: {
161
+ * afterRead(slug, entity, ctx) {
162
+ * // Mask PII for non-admin users across all collections
163
+ * if (!ctx.requestUser?.roles.includes("admin") && entity.email) {
164
+ * return { ...entity, email: "***" };
165
+ * }
166
+ * return entity;
167
+ * }
168
+ * },
169
+ * users: {
170
+ * afterRead(user, ctx) {
171
+ * if (user.email.endsWith("@system.internal")) return null;
172
+ * return user;
173
+ * }
174
+ * }
175
+ * };
176
+ * ```
177
+ *
178
+ * @group Backend Hooks
179
+ */
180
+ export interface BackendHooks {
181
+ /** Hooks for intercepting user management data */
182
+ users?: UserHooks;
183
+ /** Hooks for intercepting role management data */
184
+ roles?: RoleHooks;
185
+ /** Hooks for intercepting ALL collection entity data via the REST API */
186
+ data?: DataHooks;
187
+ }
@@ -9,6 +9,7 @@ import type { RebaseContext } from "../rebase_context";
9
9
  import type { Relation } from "./relations";
10
10
  import type { EntityCustomView } from "./entity_views";
11
11
  import type { EntityAction } from "./entity_actions";
12
+ import type { ComponentRef } from "./component_ref";
12
13
  /**
13
14
  * Base interface containing all driver-agnostic collection properties.
14
15
  * Use {@link PostgresCollection} or {@link FirebaseCollection} for
@@ -19,9 +20,8 @@ import type { EntityAction } from "./entity_actions";
19
20
  */
20
21
  export interface BaseEntityCollection<M extends Record<string, unknown> = Record<string, unknown>, USER extends User = User> {
21
22
  /**
22
- * You can set an alias that will be used internally instead of the `path`.
23
- * The `alias` value will be used to determine the URL of the collection,
24
- * while `path` will still be used in the driver.
23
+ * You can set an alias that will be used internally instead of the collection name.
24
+ * The `slug` value will be used to determine the URL of the collection.
25
25
  * Note that you can use this value in reference properties too.
26
26
  */
27
27
  slug: string;
@@ -87,6 +87,9 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
87
87
  icon?: string | React.ReactNode;
88
88
  /**
89
89
  * Navigation group for this collection.
90
+ * Collections sharing the same group name will be visually grouped
91
+ * together in the drawer and home page. If not set, the collection
92
+ * falls into the default "Views" group.
90
93
  */
91
94
  group?: string;
92
95
  /**
@@ -158,17 +161,35 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
158
161
  /**
159
162
  * Force a filter in this view. If applied, the rest of the filters will
160
163
  * be disabled. Filters applied with this prop cannot be changed.
161
- * e.g. `forceFilter: { age: [">", 18] }`
162
- * e.g. `forceFilter: { related_user: ["==", new EntityReference("sdc43dsw2", "users")] }`
164
+ * e.g. `fixedFilter: { age: [">", 18] }`
165
+ * e.g. `fixedFilter: { related_user: ["==", new EntityReference("sdc43dsw2", "users")] }`
163
166
  */
164
- readonly forceFilter?: FilterValues<Extract<keyof M, string> | (string & {})>;
167
+ readonly fixedFilter?: FilterValues<Extract<keyof M, string> | (string & {})>;
165
168
  /**
166
169
  * Initial filters applied to the collection this collection is related to.
167
170
  * Defaults to none. Filters applied with this prop can be changed.
168
- * e.g. `filter: { age: [">", 18] }`
169
- * e.g. `filter: { related_user: ["==", new EntityReference("sdc43dsw2", "users")] }`
171
+ * e.g. `defaultFilter: { age: [">", 18] }`
172
+ * e.g. `defaultFilter: { related_user: ["==", new EntityReference("sdc43dsw2", "users")] }`
170
173
  */
171
- readonly filter?: FilterValues<Extract<keyof M, string> | (string & {})>;
174
+ readonly defaultFilter?: FilterValues<Extract<keyof M, string> | (string & {})>;
175
+ /**
176
+ * Pre-defined filter presets that appear as quick-access options in the
177
+ * collection toolbar. Each preset applies a set of filters (and
178
+ * optionally a sort order) with a single click.
179
+ *
180
+ * ```ts
181
+ * filterPresets: [
182
+ * {
183
+ * label: "Shipped this month",
184
+ * filterValues: {
185
+ * status: ["==", "shipped"],
186
+ * order_date: [">=", new Date(Date.now() - 30 * 86400000)]
187
+ * }
188
+ * }
189
+ * ]
190
+ * ```
191
+ */
192
+ readonly filterPresets?: FilterPreset<Extract<keyof M, string> | (string & {})>[];
172
193
  /**
173
194
  * Default sort applied to this collection.
174
195
  * When setting this prop, entities will have a default order
@@ -302,7 +323,7 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
302
323
  /**
303
324
  * Builder for the collection actions rendered in the toolbar
304
325
  */
305
- Actions?: React.ComponentType<any>[];
326
+ Actions?: ComponentRef<CollectionActionsProps>[];
306
327
  }
307
328
  /**
308
329
  * A collection backed by PostgreSQL (or any SQL database).
@@ -314,6 +335,7 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
314
335
  * @group Models
315
336
  */
316
337
  export interface PostgresCollection<M extends Record<string, unknown> = Record<string, unknown>, USER extends User = User> extends BaseEntityCollection<M, USER> {
338
+ properties: Properties;
317
339
  /**
318
340
  * The driver for this collection. For Postgres collections this
319
341
  * can be omitted (Postgres is the default) or set to `"postgres"`.
@@ -457,7 +479,8 @@ export interface CollectionActionsProps<M extends Record<string, unknown> = Reco
457
479
  /**
458
480
  * Array of the parent path segments like `['users']`
459
481
  */
460
- parentCollectionIds: string[];
482
+ parentCollectionSlugs: string[];
483
+ parentEntityIds: string[];
461
484
  /**
462
485
  * The collection configuration
463
486
  */
@@ -481,6 +504,21 @@ export interface CollectionActionsProps<M extends Record<string, unknown> = Reco
481
504
  * undefined means the count is still loading.
482
505
  */
483
506
  collectionEntitiesCount?: number;
507
+ /**
508
+ * Programmatically open the new-document form for this collection,
509
+ * optionally pre-populating it with initial field values.
510
+ * The form opens in the same mode configured for the collection
511
+ * (side panel, full screen, or split).
512
+ *
513
+ * This is the primary hook for workflows that need to create a document
514
+ * from external data — e.g. fetching content from a URL, importing from
515
+ * a third-party API, or duplicating from another system.
516
+ *
517
+ * @example
518
+ * // Inside a custom CollectionAction component:
519
+ * openNewDocument({ title: "Fetched title", body: "..." });
520
+ */
521
+ openNewDocument: (defaultValues?: Record<string, unknown>) => void;
484
522
  }
485
523
  /**
486
524
  * Use this controller to retrieve the selected entities or modify them in
@@ -508,6 +546,32 @@ export type WhereFilterOp = "<" | "<=" | "==" | "!=" | ">=" | ">" | "array-conta
508
546
  * @group Models
509
547
  */
510
548
  export type FilterValues<Key extends string> = Partial<Record<Key, [WhereFilterOp, unknown]>>;
549
+ /**
550
+ * A pre-defined filter preset for quick access in the collection toolbar.
551
+ * Users can select a preset to instantly apply a set of filters and
552
+ * optionally a sort order.
553
+ *
554
+ * @group Models
555
+ */
556
+ export interface FilterPreset<Key extends string = string> {
557
+ /**
558
+ * Display label shown in the preset menu.
559
+ * If omitted, a summary is auto-generated from the filter keys.
560
+ */
561
+ label?: string;
562
+ /**
563
+ * The filter values to apply when this preset is selected.
564
+ */
565
+ filterValues: FilterValues<Key>;
566
+ /**
567
+ * Optional sort override to apply alongside the filter values.
568
+ */
569
+ sort?: [Key, "asc" | "desc"];
570
+ }
571
+ /**
572
+ * @deprecated Use {@link FilterPreset} instead.
573
+ */
574
+ export type QuickFilter<Key extends string = string> = FilterPreset<Key>;
511
575
  /**
512
576
  * Used to indicate valid filter combinations (e.g. created in Firestore)
513
577
  * If the user selects a specific filter/sort combination, the CMS checks if it's
@@ -0,0 +1,47 @@
1
+ import type React from "react";
2
+ /**
3
+ * Internal marker for a lazily-loaded component reference.
4
+ * Created by the Vite transform plugin when converting string paths
5
+ * to deferred `import()` calls. Users should NOT create these manually.
6
+ *
7
+ * @internal
8
+ */
9
+ export interface LazyComponentRef<P = unknown> {
10
+ readonly __rebaseLazy: true;
11
+ readonly load: () => Promise<{
12
+ default: React.ComponentType<P>;
13
+ }>;
14
+ }
15
+ /**
16
+ * A reference to a React component that can be provided in three forms:
17
+ *
18
+ * 1. **String path** (recommended for collection configs):
19
+ * ```ts
20
+ * Field: "../../frontend/src/components/MyField"
21
+ * ```
22
+ * The Vite plugin transforms this into a `LazyComponentRef` at build time.
23
+ * On the backend, the string stays inert and is never evaluated.
24
+ *
25
+ * 2. **Lazy import function**:
26
+ * ```ts
27
+ * Field: () => import("../../frontend/src/components/MyField")
28
+ * ```
29
+ * Standard ES dynamic import. Backend never calls the function.
30
+ *
31
+ * 3. **Direct component reference** (use only in frontend-only code):
32
+ * ```ts
33
+ * Field: MyFieldComponent
34
+ * ```
35
+ * Importing a component at the top level will pull React into the
36
+ * backend runtime — only safe in code that the backend never imports.
37
+ *
38
+ * @group Types
39
+ */
40
+ export type ComponentRef<P = unknown> = React.ComponentType<P> | LazyComponentRef<P> | (() => Promise<{
41
+ default: React.ComponentType<P>;
42
+ }>) | string;
43
+ /**
44
+ * Type guard: checks if a value is a `LazyComponentRef` produced by the
45
+ * Vite transform plugin.
46
+ */
47
+ export declare function isLazyComponentRef<P = unknown>(ref: unknown): ref is LazyComponentRef<P>;
@@ -1,3 +1,4 @@
1
+ import type { RebaseClient } from "../controllers/client";
1
2
  /**
2
3
  * Cron Job type definitions for Rebase.
3
4
  *
@@ -32,7 +33,6 @@ export interface CronJobDefinition {
32
33
  */
33
34
  handler: (ctx: CronJobContext) => Promise<unknown> | unknown;
34
35
  }
35
- import type { RebaseClient } from "../controllers/client";
36
36
  /**
37
37
  * Context passed to each cron handler invocation.
38
38
  */
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @module DatabaseAdapter
3
+ *
4
+ * Pluggable database abstraction for Rebase.
5
+ *
6
+ *
7
+ * A `DatabaseAdapter` focuses purely on data persistence and related concerns (realtime, history).
8
+ * It does NOT handle authentication — auth is managed separately by an `AuthAdapter`.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createPostgresAdapter } from "@rebasepro/server-postgresql";
13
+ *
14
+ * initializeRebaseBackend({
15
+ * database: createPostgresAdapter({ connection: db, schema }),
16
+ * auth: { jwtSecret: "..." },
17
+ * });
18
+ * ```
19
+ *
20
+ * @group Backend
21
+ */
22
+ import type { DataDriver } from "../controllers/data_driver";
23
+ import type { EntityCollection } from "./collections";
24
+ import type { CollectionRegistryInterface, DatabaseAdmin, InitializedDriver, RealtimeProvider } from "./backend";
25
+ /**
26
+ * A `DatabaseAdapter` provides data persistence for Rebase.
27
+ *
28
+ * @group Backend
29
+ */
30
+ export interface DatabaseAdapter {
31
+ /**
32
+ * Which database engine this adapter handles.
33
+ *
34
+ * @example "postgres", "mysql", "mongodb", "sqlite"
35
+ */
36
+ readonly type: string;
37
+ /**
38
+ * Create the DataDriver for CRUD operations.
39
+ *
40
+ * This is the only **required** method.
41
+ *
42
+ * @param config - Coordinator-provided config containing registered
43
+ * collections and the collection registry.
44
+ */
45
+ initializeDriver(config: DatabaseAdapterInitConfig): Promise<InitializedDriver>;
46
+ /**
47
+ * Create a realtime provider for this database.
48
+ *
49
+ * Return `undefined` if the database does not support realtime
50
+ * change notifications.
51
+ */
52
+ initializeRealtime?(driverResult: InitializedDriver): Promise<RealtimeProvider | undefined>;
53
+ /**
54
+ * Initialize entity history tracking.
55
+ *
56
+ * Return `undefined` if the database does not support history.
57
+ */
58
+ initializeHistory?(config: unknown, driverResult: InitializedDriver): Promise<{
59
+ historyService: unknown;
60
+ } | undefined>;
61
+ /**
62
+ * Initialize WebSocket server for realtime operations.
63
+ */
64
+ initializeWebsockets?(server: unknown, realtimeService: RealtimeProvider, driver: DataDriver, config?: unknown): Promise<void> | void;
65
+ /**
66
+ * Return admin capabilities for this database (SQL editor, schema browser, branching).
67
+ */
68
+ getAdmin?(driverResult: InitializedDriver): DatabaseAdmin | undefined;
69
+ /**
70
+ * Mount any database-specific HTTP routes (e.g., custom admin endpoints).
71
+ *
72
+ * Called after all adapters are initialized.
73
+ */
74
+ mountRoutes?(app: unknown, basePath: string, driverResult: InitializedDriver): void;
75
+ /**
76
+ * Graceful shutdown: close connections, release resources.
77
+ */
78
+ destroy?(): Promise<void>;
79
+ }
80
+ /**
81
+ * Configuration passed by the coordinator to `DatabaseAdapter.initializeDriver()`.
82
+ *
83
+ * @group Backend
84
+ */
85
+ export interface DatabaseAdapterInitConfig {
86
+ /** Registered collection definitions. */
87
+ collections: EntityCollection[];
88
+ /** The shared collection registry to register into. */
89
+ collectionRegistry: CollectionRegistryInterface;
90
+ }
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
2
  import type { Entity, EntityValues } from "./entities";
3
3
  import type { EntityCollection } from "./collections";
4
+ import type { FormexController } from "./formex";
5
+ import type { ComponentRef } from "./component_ref";
4
6
  /**
5
7
  * Context passed to custom fields and entity views.
6
- * This is the base definition — `@rebasepro/admin` re-exports a
7
- * fully-typed version that narrows the `formex` field.
8
8
  * @group Form custom fields
9
9
  */
10
10
  export interface FormContext<M extends Record<string, unknown> = Record<string, unknown>> {
@@ -38,10 +38,8 @@ export interface FormContext<M extends Record<string, unknown> = Record<string,
38
38
  openEntityMode: "side_panel" | "full_screen" | "split";
39
39
  /**
40
40
  * The underlying formex controller that powers the form.
41
- * Prefer importing `FormContext` from `@rebasepro/admin` for the
42
- * fully-typed `FormexController<M>` version.
43
41
  */
44
- formex: Record<string, unknown>;
42
+ formex: FormexController<M>;
45
43
  disabled: boolean;
46
44
  }
47
45
  export type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = {
@@ -49,7 +47,7 @@ export type EntityCustomView<M extends Record<string, unknown> = Record<string,
49
47
  name: string;
50
48
  tabComponent?: React.ReactNode;
51
49
  includeActions?: boolean | "bottom";
52
- Builder?: React.ComponentType<EntityCustomViewParams<M>>;
50
+ Builder?: ComponentRef<EntityCustomViewParams<M>>;
53
51
  position?: "start" | "end";
54
52
  };
55
53
  export interface EntityCustomViewParams<M extends Record<string, unknown> = Record<string, unknown>> {
@@ -57,5 +55,6 @@ export interface EntityCustomViewParams<M extends Record<string, unknown> = Reco
57
55
  entity?: Entity<M>;
58
56
  modifiedValues?: EntityValues<M>;
59
57
  formContext: FormContext<M>;
60
- parentCollectionIds?: string[];
58
+ parentCollectionSlugs?: string[];
59
+ parentEntityIds?: string[];
61
60
  }
@@ -0,0 +1,40 @@
1
+ import React, { FormEvent } from "react";
2
+ export type FormexController<T = any> = {
3
+ values: T;
4
+ initialValues: T;
5
+ setValues: (values: T) => void;
6
+ setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
7
+ touched: Record<string, boolean>;
8
+ setFieldTouched: (key: string, touched: boolean, shouldValidate?: boolean) => void;
9
+ setTouched: (touched: Record<string, boolean>) => void;
10
+ dirty: boolean;
11
+ setDirty: (dirty: boolean) => void;
12
+ setSubmitCount: (submitCount: number) => void;
13
+ errors: Record<string, string>;
14
+ setFieldError: (key: string, error?: string) => void;
15
+ handleChange: (event: React.SyntheticEvent) => void;
16
+ handleBlur: (event: React.FocusEvent) => void;
17
+ handleSubmit: (event?: FormEvent<HTMLFormElement>) => void;
18
+ validate: () => void;
19
+ resetForm: (props?: FormexResetProps<T>) => void;
20
+ submitCount: number;
21
+ isSubmitting: boolean;
22
+ setSubmitting: (isSubmitting: boolean) => void;
23
+ isValidating: boolean;
24
+ /**
25
+ * The version of the form. This is incremented every time the form is reset
26
+ * or the form is submitted.
27
+ */
28
+ version: number;
29
+ debugId?: string;
30
+ undo: () => void;
31
+ redo: () => void;
32
+ canUndo: boolean;
33
+ canRedo: boolean;
34
+ };
35
+ export type FormexResetProps<T = any> = {
36
+ values?: T;
37
+ submitCount?: number;
38
+ errors?: Record<string, string>;
39
+ touched?: Record<string, boolean>;
40
+ };
@@ -10,6 +10,7 @@ export * from "./entity_callbacks";
10
10
  export * from "./entity_overrides";
11
11
  export * from "./export_import";
12
12
  export * from "./modify_collections";
13
+ export * from "./formex";
13
14
  export * from "./websockets";
14
15
  export * from "./backend";
15
16
  export * from "./translations";
@@ -21,3 +22,7 @@ export * from "./property_config";
21
22
  export * from "./entity_views";
22
23
  export * from "./data_source";
23
24
  export * from "./cron";
25
+ export * from "./backend_hooks";
26
+ export * from "./component_ref";
27
+ export * from "./auth_adapter";
28
+ export * from "./database_adapter";
@@ -157,7 +157,8 @@ export interface PluginHooks {
157
157
  */
158
158
  onColumnsReorder?: (props: {
159
159
  fullPath: string;
160
- parentCollectionIds: string[];
160
+ parentCollectionSlugs: string[];
161
+ parentEntityIds: string[];
161
162
  collection: EntityCollection;
162
163
  newPropertiesOrder: string[];
163
164
  }) => void;
@@ -166,7 +167,8 @@ export interface PluginHooks {
166
167
  */
167
168
  onKanbanColumnsReorder?: (props: {
168
169
  fullPath: string;
169
- parentCollectionIds: string[];
170
+ parentCollectionSlugs: string[];
171
+ parentEntityIds: string[];
170
172
  collection: EntityCollection;
171
173
  kanbanColumnProperty: string;
172
174
  newColumnsOrder: string[];
@@ -241,7 +243,8 @@ export interface PluginHomePageActionsProps<EP extends object = object, M extend
241
243
  export interface PluginFormActionProps<USER extends User = User, EC extends EntityCollection = EntityCollection> {
242
244
  entityId?: string | number;
243
245
  path: string;
244
- parentCollectionIds: string[];
246
+ parentCollectionSlugs: string[];
247
+ parentEntityIds: string[];
245
248
  status: EntityStatus;
246
249
  collection: EC;
247
250
  disabled: boolean;