@constructive-io/schema-builder 0.2.0 → 0.4.0
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/CHANGELOG.md +23 -0
- package/README.md +12 -4
- package/dist/card-widths-CmIxkRfh.cjs +28 -0
- package/dist/card-widths-CmIxkRfh.cjs.map +1 -0
- package/dist/card-widths-pI4Kw4Xz.js +22 -0
- package/dist/card-widths-pI4Kw4Xz.js.map +1 -0
- package/dist/core-CVxnNLs7.cjs +66 -0
- package/dist/core-CVxnNLs7.cjs.map +1 -0
- package/dist/core-DJ5kA4r-.js +49 -0
- package/dist/core-DJ5kA4r-.js.map +1 -0
- package/dist/core.cjs +14 -212
- package/dist/core.d.cts +3 -54
- package/dist/core.d.ts +3 -54
- package/dist/core.js +3 -200
- package/dist/create-table-card-B6SMrt_g.js +7691 -0
- package/dist/create-table-card-B6SMrt_g.js.map +1 -0
- package/dist/create-table-card-BrQ7pB_U.cjs +7732 -0
- package/dist/create-table-card-BrQ7pB_U.cjs.map +1 -0
- package/dist/delete-confirm-dialog-Ch4tWj6B.cjs +42 -0
- package/dist/delete-confirm-dialog-Ch4tWj6B.cjs.map +1 -0
- package/dist/delete-confirm-dialog-K0AWE643.js +37 -0
- package/dist/delete-confirm-dialog-K0AWE643.js.map +1 -0
- package/dist/empty-state-card-5t7LygTB.cjs +62 -0
- package/dist/empty-state-card-5t7LygTB.cjs.map +1 -0
- package/dist/empty-state-card-C-Nylatg.js +57 -0
- package/dist/empty-state-card-C-Nylatg.js.map +1 -0
- package/dist/fields.cjs +8 -7763
- package/dist/fields.d.cts +38 -39
- package/dist/fields.d.ts +38 -39
- package/dist/fields.js +2 -7735
- package/dist/generated-types-DZMUyNBH.d.cts +27 -0
- package/dist/generated-types-DZMUyNBH.d.ts +27 -0
- package/dist/index--9KTz1LB.d.cts +56 -0
- package/dist/index-10idAfdb.d.cts +7 -0
- package/dist/index-BcdFaKFS.d.ts +7 -0
- package/dist/index-euaSKMQK.d.ts +56 -0
- package/dist/index.cjs +392 -13730
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -10
- package/dist/index.d.ts +4 -10
- package/dist/index.js +381 -13698
- package/dist/index.js.map +1 -1
- package/dist/indexes-view-CBzYpKcd.js +736 -0
- package/dist/indexes-view-CBzYpKcd.js.map +1 -0
- package/dist/indexes-view-D1K24ts1.cjs +759 -0
- package/dist/indexes-view-D1K24ts1.cjs.map +1 -0
- package/dist/indexes.cjs +6 -1041
- package/dist/indexes.d.cts +27 -27
- package/dist/indexes.d.ts +27 -27
- package/dist/indexes.js +2 -1016
- package/dist/invalidate-database-entities-BFCWf5Zf.js +2561 -0
- package/dist/invalidate-database-entities-BFCWf5Zf.js.map +1 -0
- package/dist/invalidate-database-entities-Gs5k8A-M.cjs +2864 -0
- package/dist/invalidate-database-entities-Gs5k8A-M.cjs.map +1 -0
- package/dist/keyboard-activation-BQiV0scm.js +13 -0
- package/dist/keyboard-activation-BQiV0scm.js.map +1 -0
- package/dist/keyboard-activation-D-L0IU6Y.cjs +19 -0
- package/dist/keyboard-activation-D-L0IU6Y.cjs.map +1 -0
- package/dist/policies-view-CkvGpJBo.cjs +1023 -0
- package/dist/policies-view-CkvGpJBo.cjs.map +1 -0
- package/dist/policies-view-DTfAhX7G.js +1018 -0
- package/dist/policies-view-DTfAhX7G.js.map +1 -0
- package/dist/policies.cjs +10 -5939
- package/dist/policies.d.cts +55 -50
- package/dist/policies.d.ts +55 -50
- package/dist/policies.js +4 -5911
- package/dist/policy-config-form-EEcQ9ywL.js +2502 -0
- package/dist/policy-config-form-EEcQ9ywL.js.map +1 -0
- package/dist/policy-config-form-RP9010zj.cjs +2629 -0
- package/dist/policy-config-form-RP9010zj.cjs.map +1 -0
- package/dist/policy-types-D_sYWb-b.d.cts +81 -0
- package/dist/policy-types-D_sYWb-b.d.ts +81 -0
- package/dist/query-BGtzUV7Y.cjs +233 -0
- package/dist/query-BGtzUV7Y.cjs.map +1 -0
- package/dist/query-r6j8IjQB.js +192 -0
- package/dist/query-r6j8IjQB.js.map +1 -0
- package/dist/relationships-view-C884EvGj.js +2417 -0
- package/dist/relationships-view-C884EvGj.js.map +1 -0
- package/dist/relationships-view-DlBs-gCF.cjs +2452 -0
- package/dist/relationships-view-DlBs-gCF.cjs.map +1 -0
- package/dist/relationships.cjs +9 -4328
- package/dist/relationships.d.cts +92 -92
- package/dist/relationships.d.ts +92 -92
- package/dist/relationships.js +2 -4300
- package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
- package/dist/schema-builder-sidebar-DAgK7ZTu.js +654 -0
- package/dist/schema-builder-sidebar-DAgK7ZTu.js.map +1 -0
- package/dist/schema-builder-sidebar-L3TcQeQr.cjs +671 -0
- package/dist/schema-builder-sidebar-L3TcQeQr.cjs.map +1 -0
- package/dist/table-editor-B-5i1M79.js +1906 -0
- package/dist/table-editor-B-5i1M79.js.map +1 -0
- package/dist/table-editor-BdLdVZfh.cjs +1935 -0
- package/dist/table-editor-BdLdVZfh.cjs.map +1 -0
- package/dist/tables.cjs +6 -5643
- package/dist/tables.d.cts +22 -21
- package/dist/tables.d.ts +22 -21
- package/dist/tables.js +3 -5618
- package/dist/testing.cjs +63 -62
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +62 -61
- package/dist/testing.js.map +1 -1
- package/dist/types-CXNRA22N.d.cts +450 -0
- package/dist/types-CXNRA22N.d.ts +450 -0
- package/dist/use-update-table-DlLX9fdE.js +244 -0
- package/dist/use-update-table-DlLX9fdE.js.map +1 -0
- package/dist/use-update-table-vcoHVolI.cjs +291 -0
- package/dist/use-update-table-vcoHVolI.cjs.map +1 -0
- package/package.json +8 -6
- package/dist/core.cjs.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/fields.cjs.map +0 -1
- package/dist/fields.js.map +0 -1
- package/dist/generated-types-CnAlqHU_.d.cts +0 -25
- package/dist/generated-types-CnAlqHU_.d.ts +0 -25
- package/dist/indexes.cjs.map +0 -1
- package/dist/indexes.js.map +0 -1
- package/dist/policies.cjs.map +0 -1
- package/dist/policies.js.map +0 -1
- package/dist/policy-types-CEYAR5TN.d.cts +0 -79
- package/dist/policy-types-CEYAR5TN.d.ts +0 -79
- package/dist/relationships.cjs.map +0 -1
- package/dist/relationships.js.map +0 -1
- package/dist/tables.cjs.map +0 -1
- package/dist/tables.js.map +0 -1
- package/dist/types-Du86atZ8.d.cts +0 -199
- package/dist/types-Du86atZ8.d.ts +0 -199
- package/dist/types-bX2dCrdl.d.cts +0 -52
- package/dist/types-bX2dCrdl.d.ts +0 -52
package/dist/relationships.d.cts
CHANGED
|
@@ -1,72 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare function RelationshipsView(): react.JSX.Element;
|
|
9
|
-
|
|
1
|
+
import { F as ForeignKeyAction, I as RelationshipType, S as SchemaBuilderRelationshipsCapabilities } from "./types-CXNRA22N.cjs";
|
|
2
|
+
import { n as MergedPolicyType } from "./policy-types-D_sYWb-b.cjs";
|
|
3
|
+
import { CardComponent } from "@constructive-io/ui/stack";
|
|
4
|
+
//#region src/schema/schema-builder-relationships/components/table-editor/relationships/relationships-view.d.ts
|
|
5
|
+
declare function RelationshipsView(): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relationship-mutations.d.ts
|
|
10
8
|
interface ForeignKeyConstraintInput {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
tableId: string;
|
|
10
|
+
fieldIds: string[];
|
|
11
|
+
refTableId: string;
|
|
12
|
+
refFieldIds: string[];
|
|
13
|
+
name?: string | null;
|
|
14
|
+
deleteAction?: ForeignKeyAction | null;
|
|
15
|
+
updateAction?: ForeignKeyAction | null;
|
|
16
|
+
databaseId?: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
smartTags?: Record<string, unknown> | null;
|
|
21
19
|
}
|
|
22
20
|
interface ForeignKeyConstraintPatch {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
name?: string | null;
|
|
22
|
+
fieldIds?: string[] | null;
|
|
23
|
+
refTableId?: string | null;
|
|
24
|
+
refFieldIds?: string[] | null;
|
|
25
|
+
deleteAction?: ForeignKeyAction | null;
|
|
26
|
+
updateAction?: ForeignKeyAction | null;
|
|
29
27
|
}
|
|
30
28
|
type CreateForeignKeyInput = Required<Pick<ForeignKeyConstraintInput, 'tableId' | 'fieldIds' | 'refTableId' | 'refFieldIds'>> & Pick<ForeignKeyConstraintInput, 'name' | 'deleteAction' | 'updateAction'> & {
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/** Relationship type - used to enforce 1:1 with unique constraint */
|
|
30
|
+
relationshipType?: RelationshipType;
|
|
33
31
|
};
|
|
34
32
|
type UpdateForeignKeyInput = {
|
|
35
|
-
|
|
33
|
+
id: string;
|
|
36
34
|
} & Partial<Pick<ForeignKeyConstraintPatch, 'name' | 'fieldIds' | 'refTableId' | 'refFieldIds' | 'deleteAction' | 'updateAction'>>;
|
|
37
35
|
interface DeleteForeignKeyInput {
|
|
38
|
-
|
|
36
|
+
id: string;
|
|
39
37
|
}
|
|
40
|
-
declare function useCreateForeignKey():
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
declare function useCreateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
43
41
|
}, Error, CreateForeignKeyInput, unknown>;
|
|
44
|
-
declare function useUpdateForeignKey():
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
declare function useUpdateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
47
45
|
}, Error, UpdateForeignKeyInput, unknown>;
|
|
48
|
-
declare function useDeleteForeignKey():
|
|
49
|
-
|
|
46
|
+
declare function useDeleteForeignKey(): import("@tanstack/react-query").UseMutationResult<{
|
|
47
|
+
id: string;
|
|
50
48
|
}, Error, DeleteForeignKeyInput, unknown>;
|
|
51
49
|
interface CreateManyToManyInput {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
/** First table ID */
|
|
51
|
+
tableAId: string;
|
|
52
|
+
/** Second table ID */
|
|
53
|
+
tableBId: string;
|
|
54
|
+
/** First table name (for FK field naming) */
|
|
55
|
+
tableAName: string;
|
|
56
|
+
/** Second table name (for FK field naming) */
|
|
57
|
+
tableBName: string;
|
|
58
|
+
/** Junction table name */
|
|
59
|
+
junctionTableName: string;
|
|
60
|
+
/** Primary key field ID of table A */
|
|
61
|
+
tableAPrimaryKeyFieldId: string;
|
|
62
|
+
/** Primary key field ID of table B */
|
|
63
|
+
tableBPrimaryKeyFieldId: string;
|
|
64
|
+
/** FK action on delete (default: CASCADE) */
|
|
65
|
+
deleteAction?: ForeignKeyAction;
|
|
66
|
+
/** FK action on update (default: NO_ACTION) */
|
|
67
|
+
updateAction?: ForeignKeyAction;
|
|
70
68
|
}
|
|
71
69
|
/**
|
|
72
70
|
* Creates a many-to-many relationship by:
|
|
@@ -76,46 +74,48 @@ interface CreateManyToManyInput {
|
|
|
76
74
|
* 4. Creating two FK constraints
|
|
77
75
|
* 5. Creating a composite unique constraint on (a_id, b_id) to prevent duplicates
|
|
78
76
|
*/
|
|
79
|
-
declare function useCreateManyToMany():
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
declare function useCreateManyToMany(): import("@tanstack/react-query").UseMutationResult<{
|
|
78
|
+
junctionTableId: string;
|
|
79
|
+
junctionTableName: string;
|
|
82
80
|
}, Error, CreateManyToManyInput, unknown>;
|
|
83
|
-
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relation-provision.d.ts
|
|
84
83
|
interface RelationProvisionInput {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
84
|
+
relationshipType: RelationshipType;
|
|
85
|
+
sourceTableId: string;
|
|
86
|
+
targetTableId: string;
|
|
87
|
+
/** 'c'=CASCADE, 'r'=RESTRICT, 'n'=SET NULL. Required for FK types; M2M always cascades. */
|
|
88
|
+
deleteAction?: ForeignKeyAction;
|
|
89
|
+
/** FK column name (auto-derived from target table name if omitted) */
|
|
90
|
+
fieldName?: string;
|
|
91
|
+
/** Whether FK field is NOT NULL (default: true) */
|
|
92
|
+
isRequired?: boolean;
|
|
93
|
+
/** Junction table name for M2M (auto-derived if omitted) */
|
|
94
|
+
junctionTableName?: string;
|
|
95
|
+
/** Use composite PK on junction table (M2M only) */
|
|
96
|
+
useCompositeKey?: boolean;
|
|
97
|
+
/** Source FK name override (M2M only) */
|
|
98
|
+
sourceFieldName?: string;
|
|
99
|
+
/** Target FK name override (M2M only) */
|
|
100
|
+
targetFieldName?: string;
|
|
101
|
+
/** Policy type for junction table (M2M only, default: AuthzAllowAll) */
|
|
102
|
+
policyType?: string;
|
|
103
|
+
/** Policy config data (M2M only) */
|
|
104
|
+
policyData?: Record<string, unknown>;
|
|
105
|
+
/** Resolved policy type object (M2M only, used to derive data nodes) */
|
|
106
|
+
policyTypeObj?: MergedPolicyType;
|
|
107
|
+
/** Whether to expose this M2M relation in the GraphQL API */
|
|
108
|
+
exposeInApi?: boolean;
|
|
110
109
|
}
|
|
111
110
|
interface RelationProvisionResult {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
outFieldId: string | null;
|
|
112
|
+
outJunctionTableId: string | null;
|
|
113
|
+
outSourceFieldId: string | null;
|
|
114
|
+
outTargetFieldId: string | null;
|
|
116
115
|
}
|
|
117
116
|
declare function useRelationProvision(options?: {
|
|
118
|
-
|
|
119
|
-
}):
|
|
120
|
-
|
|
121
|
-
export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
|
|
117
|
+
skipTableSelect?: boolean;
|
|
118
|
+
}): import("@tanstack/react-query").UseMutationResult<RelationProvisionResult, Error, RelationProvisionInput, unknown>;
|
|
119
|
+
//#endregion
|
|
120
|
+
export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type SchemaBuilderRelationshipsCapabilities, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
|
|
121
|
+
//# sourceMappingURL=relationships.d.cts.map
|
package/dist/relationships.d.ts
CHANGED
|
@@ -1,72 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare function RelationshipsView(): react.JSX.Element;
|
|
9
|
-
|
|
1
|
+
import { F as ForeignKeyAction, I as RelationshipType, S as SchemaBuilderRelationshipsCapabilities } from "./types-CXNRA22N.js";
|
|
2
|
+
import { n as MergedPolicyType } from "./policy-types-D_sYWb-b.js";
|
|
3
|
+
import { CardComponent } from "@constructive-io/ui/stack";
|
|
4
|
+
//#region src/schema/schema-builder-relationships/components/table-editor/relationships/relationships-view.d.ts
|
|
5
|
+
declare function RelationshipsView(): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relationship-mutations.d.ts
|
|
10
8
|
interface ForeignKeyConstraintInput {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
tableId: string;
|
|
10
|
+
fieldIds: string[];
|
|
11
|
+
refTableId: string;
|
|
12
|
+
refFieldIds: string[];
|
|
13
|
+
name?: string | null;
|
|
14
|
+
deleteAction?: ForeignKeyAction | null;
|
|
15
|
+
updateAction?: ForeignKeyAction | null;
|
|
16
|
+
databaseId?: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
smartTags?: Record<string, unknown> | null;
|
|
21
19
|
}
|
|
22
20
|
interface ForeignKeyConstraintPatch {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
name?: string | null;
|
|
22
|
+
fieldIds?: string[] | null;
|
|
23
|
+
refTableId?: string | null;
|
|
24
|
+
refFieldIds?: string[] | null;
|
|
25
|
+
deleteAction?: ForeignKeyAction | null;
|
|
26
|
+
updateAction?: ForeignKeyAction | null;
|
|
29
27
|
}
|
|
30
28
|
type CreateForeignKeyInput = Required<Pick<ForeignKeyConstraintInput, 'tableId' | 'fieldIds' | 'refTableId' | 'refFieldIds'>> & Pick<ForeignKeyConstraintInput, 'name' | 'deleteAction' | 'updateAction'> & {
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/** Relationship type - used to enforce 1:1 with unique constraint */
|
|
30
|
+
relationshipType?: RelationshipType;
|
|
33
31
|
};
|
|
34
32
|
type UpdateForeignKeyInput = {
|
|
35
|
-
|
|
33
|
+
id: string;
|
|
36
34
|
} & Partial<Pick<ForeignKeyConstraintPatch, 'name' | 'fieldIds' | 'refTableId' | 'refFieldIds' | 'deleteAction' | 'updateAction'>>;
|
|
37
35
|
interface DeleteForeignKeyInput {
|
|
38
|
-
|
|
36
|
+
id: string;
|
|
39
37
|
}
|
|
40
|
-
declare function useCreateForeignKey():
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
declare function useCreateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
43
41
|
}, Error, CreateForeignKeyInput, unknown>;
|
|
44
|
-
declare function useUpdateForeignKey():
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
declare function useUpdateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
47
45
|
}, Error, UpdateForeignKeyInput, unknown>;
|
|
48
|
-
declare function useDeleteForeignKey():
|
|
49
|
-
|
|
46
|
+
declare function useDeleteForeignKey(): import("@tanstack/react-query").UseMutationResult<{
|
|
47
|
+
id: string;
|
|
50
48
|
}, Error, DeleteForeignKeyInput, unknown>;
|
|
51
49
|
interface CreateManyToManyInput {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
/** First table ID */
|
|
51
|
+
tableAId: string;
|
|
52
|
+
/** Second table ID */
|
|
53
|
+
tableBId: string;
|
|
54
|
+
/** First table name (for FK field naming) */
|
|
55
|
+
tableAName: string;
|
|
56
|
+
/** Second table name (for FK field naming) */
|
|
57
|
+
tableBName: string;
|
|
58
|
+
/** Junction table name */
|
|
59
|
+
junctionTableName: string;
|
|
60
|
+
/** Primary key field ID of table A */
|
|
61
|
+
tableAPrimaryKeyFieldId: string;
|
|
62
|
+
/** Primary key field ID of table B */
|
|
63
|
+
tableBPrimaryKeyFieldId: string;
|
|
64
|
+
/** FK action on delete (default: CASCADE) */
|
|
65
|
+
deleteAction?: ForeignKeyAction;
|
|
66
|
+
/** FK action on update (default: NO_ACTION) */
|
|
67
|
+
updateAction?: ForeignKeyAction;
|
|
70
68
|
}
|
|
71
69
|
/**
|
|
72
70
|
* Creates a many-to-many relationship by:
|
|
@@ -76,46 +74,48 @@ interface CreateManyToManyInput {
|
|
|
76
74
|
* 4. Creating two FK constraints
|
|
77
75
|
* 5. Creating a composite unique constraint on (a_id, b_id) to prevent duplicates
|
|
78
76
|
*/
|
|
79
|
-
declare function useCreateManyToMany():
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
declare function useCreateManyToMany(): import("@tanstack/react-query").UseMutationResult<{
|
|
78
|
+
junctionTableId: string;
|
|
79
|
+
junctionTableName: string;
|
|
82
80
|
}, Error, CreateManyToManyInput, unknown>;
|
|
83
|
-
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relation-provision.d.ts
|
|
84
83
|
interface RelationProvisionInput {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
84
|
+
relationshipType: RelationshipType;
|
|
85
|
+
sourceTableId: string;
|
|
86
|
+
targetTableId: string;
|
|
87
|
+
/** 'c'=CASCADE, 'r'=RESTRICT, 'n'=SET NULL. Required for FK types; M2M always cascades. */
|
|
88
|
+
deleteAction?: ForeignKeyAction;
|
|
89
|
+
/** FK column name (auto-derived from target table name if omitted) */
|
|
90
|
+
fieldName?: string;
|
|
91
|
+
/** Whether FK field is NOT NULL (default: true) */
|
|
92
|
+
isRequired?: boolean;
|
|
93
|
+
/** Junction table name for M2M (auto-derived if omitted) */
|
|
94
|
+
junctionTableName?: string;
|
|
95
|
+
/** Use composite PK on junction table (M2M only) */
|
|
96
|
+
useCompositeKey?: boolean;
|
|
97
|
+
/** Source FK name override (M2M only) */
|
|
98
|
+
sourceFieldName?: string;
|
|
99
|
+
/** Target FK name override (M2M only) */
|
|
100
|
+
targetFieldName?: string;
|
|
101
|
+
/** Policy type for junction table (M2M only, default: AuthzAllowAll) */
|
|
102
|
+
policyType?: string;
|
|
103
|
+
/** Policy config data (M2M only) */
|
|
104
|
+
policyData?: Record<string, unknown>;
|
|
105
|
+
/** Resolved policy type object (M2M only, used to derive data nodes) */
|
|
106
|
+
policyTypeObj?: MergedPolicyType;
|
|
107
|
+
/** Whether to expose this M2M relation in the GraphQL API */
|
|
108
|
+
exposeInApi?: boolean;
|
|
110
109
|
}
|
|
111
110
|
interface RelationProvisionResult {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
outFieldId: string | null;
|
|
112
|
+
outJunctionTableId: string | null;
|
|
113
|
+
outSourceFieldId: string | null;
|
|
114
|
+
outTargetFieldId: string | null;
|
|
116
115
|
}
|
|
117
116
|
declare function useRelationProvision(options?: {
|
|
118
|
-
|
|
119
|
-
}):
|
|
120
|
-
|
|
121
|
-
export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
|
|
117
|
+
skipTableSelect?: boolean;
|
|
118
|
+
}): import("@tanstack/react-query").UseMutationResult<RelationProvisionResult, Error, RelationProvisionInput, unknown>;
|
|
119
|
+
//#endregion
|
|
120
|
+
export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type SchemaBuilderRelationshipsCapabilities, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
|
|
121
|
+
//# sourceMappingURL=relationships.d.ts.map
|