@rebasepro/client-postgresql 0.0.1-canary.bbcb8b4 → 0.0.1-canary.c53f5db
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/client/src/collection.d.ts +2 -1
- package/dist/types/src/controllers/collection_registry.d.ts +2 -1
- package/dist/types/src/controllers/data_driver.d.ts +36 -1
- package/dist/types/src/types/backend_hooks.d.ts +187 -0
- package/dist/types/src/types/collections.d.ts +10 -10
- package/dist/types/src/types/entity_views.d.ts +4 -6
- package/dist/types/src/types/formex.d.ts +40 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/plugins.d.ts +6 -3
- package/dist/types/src/types/properties.d.ts +4 -4
- package/dist/types/src/types/slots.d.ts +20 -10
- package/dist/types/src/types/translations.d.ts +4 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transport } from "./transport";
|
|
1
|
+
import { Transport, FindParams } from "./transport";
|
|
2
2
|
import { RebaseWebSocketClient } from "./websocket";
|
|
3
3
|
import { CollectionAccessor } from "@rebasepro/types";
|
|
4
4
|
import { FilterOperator, QueryBuilder } from "./query_builder";
|
|
@@ -15,5 +15,6 @@ export interface CollectionClient<M extends Record<string, unknown> = Record<str
|
|
|
15
15
|
offset(count: number): QueryBuilder<M>;
|
|
16
16
|
search(searchString: string): QueryBuilder<M>;
|
|
17
17
|
include(...relations: string[]): QueryBuilder<M>;
|
|
18
|
+
count(params?: FindParams): Promise<number>;
|
|
18
19
|
}
|
|
19
20
|
export declare function createCollectionClient<M extends Record<string, unknown> = Record<string, unknown>>(transport: Transport, slug: string, ws?: RebaseWebSocketClient): CollectionClient<M>;
|
|
@@ -36,7 +36,8 @@ export type CollectionRegistryController<DB = Record<string, unknown>, EC extend
|
|
|
36
36
|
* Retrieve all the related parent collection ids for a given path
|
|
37
37
|
* @param path
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
getParentCollectionSlugs: (path: string) => string[];
|
|
40
|
+
getParentEntityIds: (path: string) => string[];
|
|
40
41
|
/**
|
|
41
42
|
* Resolve paths from a list of ids
|
|
42
43
|
* @param ids
|
|
@@ -144,12 +144,19 @@ export interface DataDriver {
|
|
|
144
144
|
path: string;
|
|
145
145
|
databaseId?: string;
|
|
146
146
|
collection: EntityCollection;
|
|
147
|
-
|
|
147
|
+
parentCollectionSlugs?: string[];
|
|
148
|
+
parentEntityIds?: string[];
|
|
148
149
|
}) => Promise<boolean>;
|
|
149
150
|
/**
|
|
150
151
|
* Flag to indicate if the driver has requested the initialization of the text search index
|
|
151
152
|
*/
|
|
152
153
|
needsInitTextSearch?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Optional REST-optimised fetch service. When present, the REST API
|
|
156
|
+
* generator uses these methods instead of the generic `fetchEntity` /
|
|
157
|
+
* `fetchCollection` pipeline, enabling include-aware eager-loading.
|
|
158
|
+
*/
|
|
159
|
+
restFetchService?: RestFetchService;
|
|
153
160
|
/**
|
|
154
161
|
* Return the admin capabilities of this driver.
|
|
155
162
|
* @see SQLAdmin
|
|
@@ -158,3 +165,31 @@ export interface DataDriver {
|
|
|
158
165
|
*/
|
|
159
166
|
admin?: import("../types/backend").DatabaseAdmin;
|
|
160
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* REST-optimised fetch service exposed by drivers that support
|
|
170
|
+
* eager-loading of relations via `include`.
|
|
171
|
+
*
|
|
172
|
+
* The methods return flattened rows (`{ id, ...columns }`) rather
|
|
173
|
+
* than the `Entity<M>` wrapper used by the generic DataDriver API.
|
|
174
|
+
*
|
|
175
|
+
* @group DataDriver
|
|
176
|
+
*/
|
|
177
|
+
export interface RestFetchService {
|
|
178
|
+
/**
|
|
179
|
+
* Fetch a collection of flattened entities with optional relation includes.
|
|
180
|
+
*/
|
|
181
|
+
fetchCollectionForRest(collectionPath: string, options?: {
|
|
182
|
+
filter?: FilterValues<string>;
|
|
183
|
+
orderBy?: string;
|
|
184
|
+
order?: "desc" | "asc";
|
|
185
|
+
limit?: number;
|
|
186
|
+
offset?: number;
|
|
187
|
+
startAfter?: Record<string, unknown>;
|
|
188
|
+
searchString?: string;
|
|
189
|
+
databaseId?: string;
|
|
190
|
+
}, include?: string[]): Promise<Record<string, unknown>[]>;
|
|
191
|
+
/**
|
|
192
|
+
* Fetch a single flattened entity with optional relation includes.
|
|
193
|
+
*/
|
|
194
|
+
fetchEntityForRest(collectionPath: string, entityId: string | number, include?: string[], databaseId?: string): Promise<Record<string, unknown> | null>;
|
|
195
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -19,9 +19,8 @@ import type { EntityAction } from "./entity_actions";
|
|
|
19
19
|
*/
|
|
20
20
|
export interface BaseEntityCollection<M extends Record<string, unknown> = Record<string, unknown>, USER extends User = User> {
|
|
21
21
|
/**
|
|
22
|
-
* You can set an alias that will be used internally instead of the
|
|
23
|
-
* The `
|
|
24
|
-
* while `path` will still be used in the driver.
|
|
22
|
+
* You can set an alias that will be used internally instead of the collection name.
|
|
23
|
+
* The `slug` value will be used to determine the URL of the collection.
|
|
25
24
|
* Note that you can use this value in reference properties too.
|
|
26
25
|
*/
|
|
27
26
|
slug: string;
|
|
@@ -158,17 +157,17 @@ export interface BaseEntityCollection<M extends Record<string, unknown> = Record
|
|
|
158
157
|
/**
|
|
159
158
|
* Force a filter in this view. If applied, the rest of the filters will
|
|
160
159
|
* be disabled. Filters applied with this prop cannot be changed.
|
|
161
|
-
* e.g. `
|
|
162
|
-
* e.g. `
|
|
160
|
+
* e.g. `fixedFilter: { age: [">", 18] }`
|
|
161
|
+
* e.g. `fixedFilter: { related_user: ["==", new EntityReference("sdc43dsw2", "users")] }`
|
|
163
162
|
*/
|
|
164
|
-
readonly
|
|
163
|
+
readonly fixedFilter?: FilterValues<Extract<keyof M, string> | (string & {})>;
|
|
165
164
|
/**
|
|
166
165
|
* Initial filters applied to the collection this collection is related to.
|
|
167
166
|
* Defaults to none. Filters applied with this prop can be changed.
|
|
168
|
-
* e.g. `
|
|
169
|
-
* e.g. `
|
|
167
|
+
* e.g. `defaultFilter: { age: [">", 18] }`
|
|
168
|
+
* e.g. `defaultFilter: { related_user: ["==", new EntityReference("sdc43dsw2", "users")] }`
|
|
170
169
|
*/
|
|
171
|
-
readonly
|
|
170
|
+
readonly defaultFilter?: FilterValues<Extract<keyof M, string> | (string & {})>;
|
|
172
171
|
/**
|
|
173
172
|
* Default sort applied to this collection.
|
|
174
173
|
* When setting this prop, entities will have a default order
|
|
@@ -457,7 +456,8 @@ export interface CollectionActionsProps<M extends Record<string, unknown> = Reco
|
|
|
457
456
|
/**
|
|
458
457
|
* Array of the parent path segments like `['users']`
|
|
459
458
|
*/
|
|
460
|
-
|
|
459
|
+
parentCollectionSlugs: string[];
|
|
460
|
+
parentEntityIds: string[];
|
|
461
461
|
/**
|
|
462
462
|
* The collection configuration
|
|
463
463
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
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";
|
|
4
5
|
/**
|
|
5
6
|
* 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
7
|
* @group Form custom fields
|
|
9
8
|
*/
|
|
10
9
|
export interface FormContext<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
@@ -38,10 +37,8 @@ export interface FormContext<M extends Record<string, unknown> = Record<string,
|
|
|
38
37
|
openEntityMode: "side_panel" | "full_screen" | "split";
|
|
39
38
|
/**
|
|
40
39
|
* The underlying formex controller that powers the form.
|
|
41
|
-
* Prefer importing `FormContext` from `@rebasepro/admin` for the
|
|
42
|
-
* fully-typed `FormexController<M>` version.
|
|
43
40
|
*/
|
|
44
|
-
formex:
|
|
41
|
+
formex: FormexController<M>;
|
|
45
42
|
disabled: boolean;
|
|
46
43
|
}
|
|
47
44
|
export type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -57,5 +54,6 @@ export interface EntityCustomViewParams<M extends Record<string, unknown> = Reco
|
|
|
57
54
|
entity?: Entity<M>;
|
|
58
55
|
modifiedValues?: EntityValues<M>;
|
|
59
56
|
formContext: FormContext<M>;
|
|
60
|
-
|
|
57
|
+
parentCollectionSlugs?: string[];
|
|
58
|
+
parentEntityIds?: string[];
|
|
61
59
|
}
|
|
@@ -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,4 @@ 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";
|
|
@@ -157,7 +157,8 @@ export interface PluginHooks {
|
|
|
157
157
|
*/
|
|
158
158
|
onColumnsReorder?: (props: {
|
|
159
159
|
fullPath: string;
|
|
160
|
-
|
|
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
|
-
|
|
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
|
-
|
|
246
|
+
parentCollectionSlugs: string[];
|
|
247
|
+
parentEntityIds: string[];
|
|
245
248
|
status: EntityStatus;
|
|
246
249
|
collection: EC;
|
|
247
250
|
disabled: boolean;
|
|
@@ -384,9 +384,9 @@ export interface ReferenceProperty extends BaseProperty {
|
|
|
384
384
|
path?: string;
|
|
385
385
|
/**
|
|
386
386
|
* Allow selection of entities that pass the given filter only.
|
|
387
|
-
* e.g. `
|
|
387
|
+
* e.g. `fixedFilter: { age: [">=", 18] }`
|
|
388
388
|
*/
|
|
389
|
-
|
|
389
|
+
fixedFilter?: FilterValues<string>;
|
|
390
390
|
/**
|
|
391
391
|
* Properties that need to be rendered when displaying a preview of this
|
|
392
392
|
* reference. If not specified the first 3 are used. Only the first 3
|
|
@@ -492,9 +492,9 @@ export interface RelationProperty extends BaseProperty {
|
|
|
492
492
|
relation?: Relation;
|
|
493
493
|
/**
|
|
494
494
|
* Allow selection of entities that pass the given filter only.
|
|
495
|
-
* e.g. `
|
|
495
|
+
* e.g. `fixedFilter: { age: [">=", 18] }`
|
|
496
496
|
*/
|
|
497
|
-
|
|
497
|
+
fixedFilter?: FilterValues<string>;
|
|
498
498
|
/**
|
|
499
499
|
* Properties that need to be rendered when displaying a preview of this
|
|
500
500
|
* reference. If not specified the first 3 are used. Only the first 3
|
|
@@ -100,7 +100,8 @@ export interface NavigationSlotProps {
|
|
|
100
100
|
export interface CollectionToolbarProps {
|
|
101
101
|
path: string;
|
|
102
102
|
collection: EntityCollection;
|
|
103
|
-
|
|
103
|
+
parentCollectionSlugs: string[];
|
|
104
|
+
parentEntityIds: string[];
|
|
104
105
|
tableController: EntityTableController;
|
|
105
106
|
selectionController: SelectionController;
|
|
106
107
|
}
|
|
@@ -111,7 +112,8 @@ export interface CollectionToolbarProps {
|
|
|
111
112
|
export interface CollectionEmptyStateProps {
|
|
112
113
|
path: string;
|
|
113
114
|
collection: EntityCollection;
|
|
114
|
-
|
|
115
|
+
parentCollectionSlugs: string[];
|
|
116
|
+
parentEntityIds: string[];
|
|
115
117
|
canCreate: boolean;
|
|
116
118
|
onNewClick?: () => void;
|
|
117
119
|
}
|
|
@@ -123,7 +125,8 @@ export interface CollectionHeaderActionProps {
|
|
|
123
125
|
property: Property;
|
|
124
126
|
propertyKey: string;
|
|
125
127
|
path: string;
|
|
126
|
-
|
|
128
|
+
parentCollectionSlugs: string[];
|
|
129
|
+
parentEntityIds: string[];
|
|
127
130
|
onHover: boolean;
|
|
128
131
|
collection: EntityCollection;
|
|
129
132
|
tableController: EntityTableController;
|
|
@@ -134,7 +137,8 @@ export interface CollectionHeaderActionProps {
|
|
|
134
137
|
*/
|
|
135
138
|
export interface CollectionAddColumnProps {
|
|
136
139
|
path: string;
|
|
137
|
-
|
|
140
|
+
parentCollectionSlugs: string[];
|
|
141
|
+
parentEntityIds: string[];
|
|
138
142
|
collection: EntityCollection;
|
|
139
143
|
tableController: EntityTableController;
|
|
140
144
|
}
|
|
@@ -145,7 +149,8 @@ export interface CollectionAddColumnProps {
|
|
|
145
149
|
export interface CollectionErrorProps {
|
|
146
150
|
path: string;
|
|
147
151
|
collection: EntityCollection;
|
|
148
|
-
|
|
152
|
+
parentCollectionSlugs?: string[];
|
|
153
|
+
parentEntityIds?: string[];
|
|
149
154
|
error: Error;
|
|
150
155
|
}
|
|
151
156
|
/**
|
|
@@ -155,7 +160,8 @@ export interface CollectionErrorProps {
|
|
|
155
160
|
export interface KanbanSetupProps {
|
|
156
161
|
collection: EntityCollection;
|
|
157
162
|
fullPath: string;
|
|
158
|
-
|
|
163
|
+
parentCollectionSlugs: string[];
|
|
164
|
+
parentEntityIds: string[];
|
|
159
165
|
}
|
|
160
166
|
/**
|
|
161
167
|
* Props for the `kanban.add-column` slot.
|
|
@@ -164,7 +170,8 @@ export interface KanbanSetupProps {
|
|
|
164
170
|
export interface KanbanAddColumnProps {
|
|
165
171
|
collection: EntityCollection;
|
|
166
172
|
fullPath: string;
|
|
167
|
-
|
|
173
|
+
parentCollectionSlugs: string[];
|
|
174
|
+
parentEntityIds: string[];
|
|
168
175
|
columnProperty: string;
|
|
169
176
|
}
|
|
170
177
|
/**
|
|
@@ -177,7 +184,8 @@ export interface EntityRowActionsProps {
|
|
|
177
184
|
entityId: string;
|
|
178
185
|
path: string;
|
|
179
186
|
collection: EntityCollection;
|
|
180
|
-
|
|
187
|
+
parentCollectionSlugs: string[];
|
|
188
|
+
parentEntityIds: string[];
|
|
181
189
|
selectionController: SelectionController;
|
|
182
190
|
context: RebaseContext;
|
|
183
191
|
}
|
|
@@ -202,7 +210,8 @@ export interface EntityFieldSlotProps {
|
|
|
202
210
|
export interface CollectionFilterPanelProps {
|
|
203
211
|
path: string;
|
|
204
212
|
collection: EntityCollection;
|
|
205
|
-
|
|
213
|
+
parentCollectionSlugs: string[];
|
|
214
|
+
parentEntityIds: string[];
|
|
206
215
|
tableController: EntityTableController;
|
|
207
216
|
context: RebaseContext;
|
|
208
217
|
}
|
|
@@ -238,7 +247,8 @@ export interface ShellToolbarProps {
|
|
|
238
247
|
export interface CollectionInsightsSlotProps {
|
|
239
248
|
path: string;
|
|
240
249
|
collection: EntityCollection;
|
|
241
|
-
|
|
250
|
+
parentCollectionSlugs: string[];
|
|
251
|
+
parentEntityIds: string[];
|
|
242
252
|
}
|
|
243
253
|
/**
|
|
244
254
|
* Props for `home.card.insight` slot.
|
|
@@ -461,6 +461,10 @@ export interface RebaseTranslations {
|
|
|
461
461
|
reset_password_success?: string;
|
|
462
462
|
reset_password_confirmation?: string;
|
|
463
463
|
error_resetting_password?: string;
|
|
464
|
+
/** Permission-denied empty states */
|
|
465
|
+
no_permission_to_view_users?: string;
|
|
466
|
+
no_permission_to_view_roles?: string;
|
|
467
|
+
no_permission_description?: string;
|
|
464
468
|
/** Editor table-bubble */
|
|
465
469
|
add_row_before: string;
|
|
466
470
|
add_row_after: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/client-postgresql",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.1-canary.
|
|
4
|
+
"version": "0.0.1-canary.c53f5db",
|
|
5
5
|
"description": "PostgreSQL data source client for Rebase",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"./package.json": "./package.json"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@rebasepro/client": "0.0.1-canary.
|
|
61
|
-
"@rebasepro/types": "0.0.1-canary.
|
|
60
|
+
"@rebasepro/client": "0.0.1-canary.c53f5db",
|
|
61
|
+
"@rebasepro/types": "0.0.1-canary.c53f5db"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"react": ">=19.0.0",
|