@standardbeagle/edit-db 0.4.416 → 0.4.418
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/editor.es.js +2066 -2038
- package/dist/editor.umd.cjs +27 -27
- package/dist/lib/polymorphic.d.ts +11 -0
- package/dist/lib/polymorphic.test.d.ts +1 -0
- package/dist/lib/query-builder.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Join } from '../types/schema';
|
|
2
|
+
/**
|
|
3
|
+
* Locate the parent table's multi-join that targets a given child table. When
|
|
4
|
+
* the parent has more than one multi-join to the same child (e.g. a polymorphic
|
|
5
|
+
* shared table mapped under several parents, or a self-FK alias), `idColumn`
|
|
6
|
+
* (the child destination column) disambiguates. Returns `undefined` when no
|
|
7
|
+
* matching multi-join exists.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveChildJoin(parentMultiJoins: Join[] | undefined, childTable: string, idColumn?: string): Join | undefined;
|
|
10
|
+
/** The child collection field name on the parent type for a given join. */
|
|
11
|
+
export declare function childFieldName(join: Join): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -49,4 +49,34 @@ export declare function getPkTypes(table: Table): PkTypeInfo[];
|
|
|
49
49
|
*/
|
|
50
50
|
export declare function buildPkEqVariables(idRoute: string, table: Table): Record<string, unknown>;
|
|
51
51
|
export declare function buildQuery(table: Table, schema: Schema, filterString: string, columnFilters: ColumnFiltersState, id?: string, tableFilter?: string, filterColumn?: string): string | null;
|
|
52
|
+
export interface DrillDownTarget {
|
|
53
|
+
/** The parent table whose row owns the child collection. */
|
|
54
|
+
parentTable: Table;
|
|
55
|
+
/** The child collection field name on the parent type. */
|
|
56
|
+
childField: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the parent table + child collection field for a parent→child
|
|
60
|
+
* related-records drill-down. The child is `table`; the parent is `tableFilter`
|
|
61
|
+
* (or the destination of `table`'s single-join named `tableFilter` when the
|
|
62
|
+
* relationship is described from the child side). `filterColumn` (the child
|
|
63
|
+
* destination column) disambiguates when the parent has several multi-joins to
|
|
64
|
+
* the same child. Returns `null` when no parent multi-join targets the child —
|
|
65
|
+
* the caller then falls back to the standard (non-traversal) query.
|
|
66
|
+
*/
|
|
67
|
+
export interface PagedResult {
|
|
68
|
+
data: unknown[];
|
|
69
|
+
total: number;
|
|
70
|
+
offset: number;
|
|
71
|
+
limit: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Unwrap the nested paged child collection from a MODEL B drill-down response.
|
|
75
|
+
*
|
|
76
|
+
* The query shape is `{ <parentField>: { data: [ { <childField>: <paged> } ] } }`.
|
|
77
|
+
* Returns the child's `{total,offset,limit,data}` page, or an empty page when the
|
|
78
|
+
* parent row was not found (no children / unknown id).
|
|
79
|
+
*/
|
|
80
|
+
export declare function unwrapDrillDownPage(response: Record<string, unknown> | null | undefined, parentField: string, childField: string): PagedResult;
|
|
81
|
+
export declare function resolveDrillDown(table: Table, schema: Schema, tableFilter?: string, filterColumn?: string): DrillDownTarget | null;
|
|
52
82
|
export {};
|