@constructive-io/schema-builder 0.2.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/card-widths-CmIxkRfh.cjs +28 -0
  3. package/dist/card-widths-CmIxkRfh.cjs.map +1 -0
  4. package/dist/card-widths-pI4Kw4Xz.js +22 -0
  5. package/dist/card-widths-pI4Kw4Xz.js.map +1 -0
  6. package/dist/core-WwCS0CKu.cjs +66 -0
  7. package/dist/core-WwCS0CKu.cjs.map +1 -0
  8. package/dist/core-kx6KjxE5.js +49 -0
  9. package/dist/core-kx6KjxE5.js.map +1 -0
  10. package/dist/core.cjs +14 -212
  11. package/dist/core.d.cts +3 -54
  12. package/dist/core.d.ts +3 -54
  13. package/dist/core.js +3 -200
  14. package/dist/create-table-card-BzNKfpXO.cjs +7726 -0
  15. package/dist/create-table-card-BzNKfpXO.cjs.map +1 -0
  16. package/dist/create-table-card-pZ0Aq6rr.js +7685 -0
  17. package/dist/create-table-card-pZ0Aq6rr.js.map +1 -0
  18. package/dist/delete-confirm-dialog-Ch4tWj6B.cjs +42 -0
  19. package/dist/delete-confirm-dialog-Ch4tWj6B.cjs.map +1 -0
  20. package/dist/delete-confirm-dialog-K0AWE643.js +37 -0
  21. package/dist/delete-confirm-dialog-K0AWE643.js.map +1 -0
  22. package/dist/empty-state-card-DMn8ADRq.cjs +62 -0
  23. package/dist/empty-state-card-DMn8ADRq.cjs.map +1 -0
  24. package/dist/empty-state-card-Dnn36JVH.js +57 -0
  25. package/dist/empty-state-card-Dnn36JVH.js.map +1 -0
  26. package/dist/fields.cjs +8 -7763
  27. package/dist/fields.d.cts +39 -39
  28. package/dist/fields.d.ts +39 -39
  29. package/dist/fields.js +2 -7735
  30. package/dist/generated-types-DZMUyNBH.d.cts +27 -0
  31. package/dist/generated-types-DZMUyNBH.d.ts +27 -0
  32. package/dist/index-9h0EROdb.d.cts +56 -0
  33. package/dist/index-CwQ9QpxA.d.ts +7 -0
  34. package/dist/index-DOWB1UBK.d.cts +56 -0
  35. package/dist/index-DOWB1UBK.d.ts +56 -0
  36. package/dist/index-Dgb_e3AP.d.cts +7 -0
  37. package/dist/index-p_NegPQ5.d.ts +56 -0
  38. package/dist/index.cjs +736 -13712
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +4 -10
  41. package/dist/index.d.ts +4 -10
  42. package/dist/index.js +725 -13680
  43. package/dist/index.js.map +1 -1
  44. package/dist/indexes-view-CJ1WQKdp.js +736 -0
  45. package/dist/indexes-view-CJ1WQKdp.js.map +1 -0
  46. package/dist/indexes-view-peIv6QUZ.cjs +759 -0
  47. package/dist/indexes-view-peIv6QUZ.cjs.map +1 -0
  48. package/dist/indexes.cjs +6 -1041
  49. package/dist/indexes.d.cts +27 -27
  50. package/dist/indexes.d.ts +27 -27
  51. package/dist/indexes.js +2 -1016
  52. package/dist/invalidate-database-entities-9DsT5NlP.cjs +2862 -0
  53. package/dist/invalidate-database-entities-9DsT5NlP.cjs.map +1 -0
  54. package/dist/invalidate-database-entities-CmmOT3S0.js +2559 -0
  55. package/dist/invalidate-database-entities-CmmOT3S0.js.map +1 -0
  56. package/dist/keyboard-activation-BQiV0scm.js +13 -0
  57. package/dist/keyboard-activation-BQiV0scm.js.map +1 -0
  58. package/dist/keyboard-activation-D-L0IU6Y.cjs +19 -0
  59. package/dist/keyboard-activation-D-L0IU6Y.cjs.map +1 -0
  60. package/dist/policies-view-BRbpbyB6.js +1018 -0
  61. package/dist/policies-view-BRbpbyB6.js.map +1 -0
  62. package/dist/policies-view-H1HTjpmv.cjs +1023 -0
  63. package/dist/policies-view-H1HTjpmv.cjs.map +1 -0
  64. package/dist/policies.cjs +10 -5939
  65. package/dist/policies.d.cts +55 -50
  66. package/dist/policies.d.ts +55 -50
  67. package/dist/policies.js +4 -5911
  68. package/dist/policy-config-form-BwyK7DGV.js +2502 -0
  69. package/dist/policy-config-form-BwyK7DGV.js.map +1 -0
  70. package/dist/policy-config-form-CefFo6Fw.cjs +2629 -0
  71. package/dist/policy-config-form-CefFo6Fw.cjs.map +1 -0
  72. package/dist/policy-types-D_sYWb-b.d.cts +81 -0
  73. package/dist/policy-types-D_sYWb-b.d.ts +81 -0
  74. package/dist/query-BmN_qO0W.js +171 -0
  75. package/dist/query-BmN_qO0W.js.map +1 -0
  76. package/dist/query-DU-KZleN.cjs +212 -0
  77. package/dist/query-DU-KZleN.cjs.map +1 -0
  78. package/dist/relationships-view-B5TAcPHU.cjs +2452 -0
  79. package/dist/relationships-view-B5TAcPHU.cjs.map +1 -0
  80. package/dist/relationships-view-DbwFh5r-.js +2417 -0
  81. package/dist/relationships-view-DbwFh5r-.js.map +1 -0
  82. package/dist/relationships.cjs +9 -4328
  83. package/dist/relationships.d.cts +93 -92
  84. package/dist/relationships.d.ts +93 -92
  85. package/dist/relationships.js +2 -4300
  86. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  87. package/dist/schema-builder-sidebar-Ctu621Vw.cjs +604 -0
  88. package/dist/schema-builder-sidebar-Ctu621Vw.cjs.map +1 -0
  89. package/dist/schema-builder-sidebar-VR-Ctidc.js +593 -0
  90. package/dist/schema-builder-sidebar-VR-Ctidc.js.map +1 -0
  91. package/dist/table-editor-C-hHz3DJ.cjs +1935 -0
  92. package/dist/table-editor-C-hHz3DJ.cjs.map +1 -0
  93. package/dist/table-editor-IVp3B4nG.js +1906 -0
  94. package/dist/table-editor-IVp3B4nG.js.map +1 -0
  95. package/dist/tables.cjs +6 -5643
  96. package/dist/tables.d.cts +22 -21
  97. package/dist/tables.d.ts +22 -21
  98. package/dist/tables.js +3 -5618
  99. package/dist/testing.cjs +63 -62
  100. package/dist/testing.cjs.map +1 -1
  101. package/dist/testing.d.cts +4 -4
  102. package/dist/testing.d.ts +4 -4
  103. package/dist/testing.js +62 -61
  104. package/dist/testing.js.map +1 -1
  105. package/dist/types-GUrH1Qny.d.cts +200 -0
  106. package/dist/types-GUrH1Qny.d.ts +200 -0
  107. package/dist/use-update-table-C7v3gRyG.cjs +291 -0
  108. package/dist/use-update-table-C7v3gRyG.cjs.map +1 -0
  109. package/dist/use-update-table-Dz6knGoH.js +244 -0
  110. package/dist/use-update-table-Dz6knGoH.js.map +1 -0
  111. package/package.json +6 -6
  112. package/dist/core.cjs.map +0 -1
  113. package/dist/core.js.map +0 -1
  114. package/dist/fields.cjs.map +0 -1
  115. package/dist/fields.js.map +0 -1
  116. package/dist/generated-types-CnAlqHU_.d.cts +0 -25
  117. package/dist/generated-types-CnAlqHU_.d.ts +0 -25
  118. package/dist/indexes.cjs.map +0 -1
  119. package/dist/indexes.js.map +0 -1
  120. package/dist/policies.cjs.map +0 -1
  121. package/dist/policies.js.map +0 -1
  122. package/dist/policy-types-CEYAR5TN.d.cts +0 -79
  123. package/dist/policy-types-CEYAR5TN.d.ts +0 -79
  124. package/dist/relationships.cjs.map +0 -1
  125. package/dist/relationships.js.map +0 -1
  126. package/dist/tables.cjs.map +0 -1
  127. package/dist/tables.js.map +0 -1
  128. package/dist/types-Du86atZ8.d.cts +0 -199
  129. package/dist/types-Du86atZ8.d.ts +0 -199
  130. package/dist/types-bX2dCrdl.d.cts +0 -52
  131. package/dist/types-bX2dCrdl.d.ts +0 -52
@@ -1,72 +1,71 @@
1
- import * as react from 'react';
2
- import * as _tanstack_react_query from '@tanstack/react-query';
3
- import { a as ForeignKeyAction, R as RelationshipType } from './types-bX2dCrdl.cjs';
4
- import { M as MergedPolicyType } from './policy-types-CEYAR5TN.cjs';
5
- export { t as SchemaBuilderRelationshipsCapabilities } from './types-Du86atZ8.cjs';
6
- import 'lucide-react';
7
-
8
- declare function RelationshipsView(): react.JSX.Element;
9
-
1
+ import { S as SchemaBuilderRelationshipsCapabilities } from "./types-GUrH1Qny.cjs";
2
+ import { n as ForeignKeyAction, r as RelationshipType } from "./index-DOWB1UBK.cjs";
3
+ import { n as MergedPolicyType } from "./policy-types-D_sYWb-b.cjs";
4
+ import { CardComponent } from "@constructive-io/ui/stack";
5
+ //#region src/schema/schema-builder-relationships/components/table-editor/relationships/relationships-view.d.ts
6
+ declare function RelationshipsView(): import("react").JSX.Element;
7
+ //#endregion
8
+ //#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relationship-mutations.d.ts
10
9
  interface ForeignKeyConstraintInput {
11
- tableId: string;
12
- fieldIds: string[];
13
- refTableId: string;
14
- refFieldIds: string[];
15
- name?: string | null;
16
- deleteAction?: ForeignKeyAction | null;
17
- updateAction?: ForeignKeyAction | null;
18
- databaseId?: string;
19
- type?: string;
20
- smartTags?: Record<string, unknown> | null;
10
+ tableId: string;
11
+ fieldIds: string[];
12
+ refTableId: string;
13
+ refFieldIds: string[];
14
+ name?: string | null;
15
+ deleteAction?: ForeignKeyAction | null;
16
+ updateAction?: ForeignKeyAction | null;
17
+ databaseId?: string;
18
+ type?: string;
19
+ smartTags?: Record<string, unknown> | null;
21
20
  }
22
21
  interface ForeignKeyConstraintPatch {
23
- name?: string | null;
24
- fieldIds?: string[] | null;
25
- refTableId?: string | null;
26
- refFieldIds?: string[] | null;
27
- deleteAction?: ForeignKeyAction | null;
28
- updateAction?: ForeignKeyAction | null;
22
+ name?: string | null;
23
+ fieldIds?: string[] | null;
24
+ refTableId?: string | null;
25
+ refFieldIds?: string[] | null;
26
+ deleteAction?: ForeignKeyAction | null;
27
+ updateAction?: ForeignKeyAction | null;
29
28
  }
30
29
  type CreateForeignKeyInput = Required<Pick<ForeignKeyConstraintInput, 'tableId' | 'fieldIds' | 'refTableId' | 'refFieldIds'>> & Pick<ForeignKeyConstraintInput, 'name' | 'deleteAction' | 'updateAction'> & {
31
- /** Relationship type - used to enforce 1:1 with unique constraint */
32
- relationshipType?: RelationshipType;
30
+ /** Relationship type - used to enforce 1:1 with unique constraint */
31
+ relationshipType?: RelationshipType;
33
32
  };
34
33
  type UpdateForeignKeyInput = {
35
- id: string;
34
+ id: string;
36
35
  } & Partial<Pick<ForeignKeyConstraintPatch, 'name' | 'fieldIds' | 'refTableId' | 'refFieldIds' | 'deleteAction' | 'updateAction'>>;
37
36
  interface DeleteForeignKeyInput {
38
- id: string;
37
+ id: string;
39
38
  }
40
- declare function useCreateForeignKey(): _tanstack_react_query.UseMutationResult<{
41
- id: string;
42
- name: string;
39
+ declare function useCreateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
40
+ id: string;
41
+ name: string;
43
42
  }, Error, CreateForeignKeyInput, unknown>;
44
- declare function useUpdateForeignKey(): _tanstack_react_query.UseMutationResult<{
45
- id: string;
46
- name: string;
43
+ declare function useUpdateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
44
+ id: string;
45
+ name: string;
47
46
  }, Error, UpdateForeignKeyInput, unknown>;
48
- declare function useDeleteForeignKey(): _tanstack_react_query.UseMutationResult<{
49
- id: string;
47
+ declare function useDeleteForeignKey(): import("@tanstack/react-query").UseMutationResult<{
48
+ id: string;
50
49
  }, Error, DeleteForeignKeyInput, unknown>;
51
50
  interface CreateManyToManyInput {
52
- /** First table ID */
53
- tableAId: string;
54
- /** Second table ID */
55
- tableBId: string;
56
- /** First table name (for FK field naming) */
57
- tableAName: string;
58
- /** Second table name (for FK field naming) */
59
- tableBName: string;
60
- /** Junction table name */
61
- junctionTableName: string;
62
- /** Primary key field ID of table A */
63
- tableAPrimaryKeyFieldId: string;
64
- /** Primary key field ID of table B */
65
- tableBPrimaryKeyFieldId: string;
66
- /** FK action on delete (default: CASCADE) */
67
- deleteAction?: ForeignKeyAction;
68
- /** FK action on update (default: NO_ACTION) */
69
- updateAction?: ForeignKeyAction;
51
+ /** First table ID */
52
+ tableAId: string;
53
+ /** Second table ID */
54
+ tableBId: string;
55
+ /** First table name (for FK field naming) */
56
+ tableAName: string;
57
+ /** Second table name (for FK field naming) */
58
+ tableBName: string;
59
+ /** Junction table name */
60
+ junctionTableName: string;
61
+ /** Primary key field ID of table A */
62
+ tableAPrimaryKeyFieldId: string;
63
+ /** Primary key field ID of table B */
64
+ tableBPrimaryKeyFieldId: string;
65
+ /** FK action on delete (default: CASCADE) */
66
+ deleteAction?: ForeignKeyAction;
67
+ /** FK action on update (default: NO_ACTION) */
68
+ updateAction?: ForeignKeyAction;
70
69
  }
71
70
  /**
72
71
  * Creates a many-to-many relationship by:
@@ -76,46 +75,48 @@ interface CreateManyToManyInput {
76
75
  * 4. Creating two FK constraints
77
76
  * 5. Creating a composite unique constraint on (a_id, b_id) to prevent duplicates
78
77
  */
79
- declare function useCreateManyToMany(): _tanstack_react_query.UseMutationResult<{
80
- junctionTableId: string;
81
- junctionTableName: string;
78
+ declare function useCreateManyToMany(): import("@tanstack/react-query").UseMutationResult<{
79
+ junctionTableId: string;
80
+ junctionTableName: string;
82
81
  }, Error, CreateManyToManyInput, unknown>;
83
-
82
+ //#endregion
83
+ //#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relation-provision.d.ts
84
84
  interface RelationProvisionInput {
85
- relationshipType: RelationshipType;
86
- sourceTableId: string;
87
- targetTableId: string;
88
- /** 'c'=CASCADE, 'r'=RESTRICT, 'n'=SET NULL. Required for FK types; M2M always cascades. */
89
- deleteAction?: ForeignKeyAction;
90
- /** FK column name (auto-derived from target table name if omitted) */
91
- fieldName?: string;
92
- /** Whether FK field is NOT NULL (default: true) */
93
- isRequired?: boolean;
94
- /** Junction table name for M2M (auto-derived if omitted) */
95
- junctionTableName?: string;
96
- /** Use composite PK on junction table (M2M only) */
97
- useCompositeKey?: boolean;
98
- /** Source FK name override (M2M only) */
99
- sourceFieldName?: string;
100
- /** Target FK name override (M2M only) */
101
- targetFieldName?: string;
102
- /** Policy type for junction table (M2M only, default: AuthzAllowAll) */
103
- policyType?: string;
104
- /** Policy config data (M2M only) */
105
- policyData?: Record<string, unknown>;
106
- /** Resolved policy type object (M2M only, used to derive data nodes) */
107
- policyTypeObj?: MergedPolicyType;
108
- /** Whether to expose this M2M relation in the GraphQL API */
109
- exposeInApi?: boolean;
85
+ relationshipType: RelationshipType;
86
+ sourceTableId: string;
87
+ targetTableId: string;
88
+ /** 'c'=CASCADE, 'r'=RESTRICT, 'n'=SET NULL. Required for FK types; M2M always cascades. */
89
+ deleteAction?: ForeignKeyAction;
90
+ /** FK column name (auto-derived from target table name if omitted) */
91
+ fieldName?: string;
92
+ /** Whether FK field is NOT NULL (default: true) */
93
+ isRequired?: boolean;
94
+ /** Junction table name for M2M (auto-derived if omitted) */
95
+ junctionTableName?: string;
96
+ /** Use composite PK on junction table (M2M only) */
97
+ useCompositeKey?: boolean;
98
+ /** Source FK name override (M2M only) */
99
+ sourceFieldName?: string;
100
+ /** Target FK name override (M2M only) */
101
+ targetFieldName?: string;
102
+ /** Policy type for junction table (M2M only, default: AuthzAllowAll) */
103
+ policyType?: string;
104
+ /** Policy config data (M2M only) */
105
+ policyData?: Record<string, unknown>;
106
+ /** Resolved policy type object (M2M only, used to derive data nodes) */
107
+ policyTypeObj?: MergedPolicyType;
108
+ /** Whether to expose this M2M relation in the GraphQL API */
109
+ exposeInApi?: boolean;
110
110
  }
111
111
  interface RelationProvisionResult {
112
- outFieldId: string | null;
113
- outJunctionTableId: string | null;
114
- outSourceFieldId: string | null;
115
- outTargetFieldId: string | null;
112
+ outFieldId: string | null;
113
+ outJunctionTableId: string | null;
114
+ outSourceFieldId: string | null;
115
+ outTargetFieldId: string | null;
116
116
  }
117
117
  declare function useRelationProvision(options?: {
118
- skipTableSelect?: boolean;
119
- }): _tanstack_react_query.UseMutationResult<RelationProvisionResult, Error, RelationProvisionInput, unknown>;
120
-
121
- export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
118
+ skipTableSelect?: boolean;
119
+ }): import("@tanstack/react-query").UseMutationResult<RelationProvisionResult, Error, RelationProvisionInput, unknown>;
120
+ //#endregion
121
+ export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type SchemaBuilderRelationshipsCapabilities, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
122
+ //# sourceMappingURL=relationships.d.cts.map
@@ -1,72 +1,71 @@
1
- import * as react from 'react';
2
- import * as _tanstack_react_query from '@tanstack/react-query';
3
- import { a as ForeignKeyAction, R as RelationshipType } from './types-bX2dCrdl.js';
4
- import { M as MergedPolicyType } from './policy-types-CEYAR5TN.js';
5
- export { t as SchemaBuilderRelationshipsCapabilities } from './types-Du86atZ8.js';
6
- import 'lucide-react';
7
-
8
- declare function RelationshipsView(): react.JSX.Element;
9
-
1
+ import { S as SchemaBuilderRelationshipsCapabilities } from "./types-GUrH1Qny.js";
2
+ import { n as ForeignKeyAction, r as RelationshipType } from "./index-DOWB1UBK.js";
3
+ import { n as MergedPolicyType } from "./policy-types-D_sYWb-b.js";
4
+ import { CardComponent } from "@constructive-io/ui/stack";
5
+ //#region src/schema/schema-builder-relationships/components/table-editor/relationships/relationships-view.d.ts
6
+ declare function RelationshipsView(): import("react").JSX.Element;
7
+ //#endregion
8
+ //#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relationship-mutations.d.ts
10
9
  interface ForeignKeyConstraintInput {
11
- tableId: string;
12
- fieldIds: string[];
13
- refTableId: string;
14
- refFieldIds: string[];
15
- name?: string | null;
16
- deleteAction?: ForeignKeyAction | null;
17
- updateAction?: ForeignKeyAction | null;
18
- databaseId?: string;
19
- type?: string;
20
- smartTags?: Record<string, unknown> | null;
10
+ tableId: string;
11
+ fieldIds: string[];
12
+ refTableId: string;
13
+ refFieldIds: string[];
14
+ name?: string | null;
15
+ deleteAction?: ForeignKeyAction | null;
16
+ updateAction?: ForeignKeyAction | null;
17
+ databaseId?: string;
18
+ type?: string;
19
+ smartTags?: Record<string, unknown> | null;
21
20
  }
22
21
  interface ForeignKeyConstraintPatch {
23
- name?: string | null;
24
- fieldIds?: string[] | null;
25
- refTableId?: string | null;
26
- refFieldIds?: string[] | null;
27
- deleteAction?: ForeignKeyAction | null;
28
- updateAction?: ForeignKeyAction | null;
22
+ name?: string | null;
23
+ fieldIds?: string[] | null;
24
+ refTableId?: string | null;
25
+ refFieldIds?: string[] | null;
26
+ deleteAction?: ForeignKeyAction | null;
27
+ updateAction?: ForeignKeyAction | null;
29
28
  }
30
29
  type CreateForeignKeyInput = Required<Pick<ForeignKeyConstraintInput, 'tableId' | 'fieldIds' | 'refTableId' | 'refFieldIds'>> & Pick<ForeignKeyConstraintInput, 'name' | 'deleteAction' | 'updateAction'> & {
31
- /** Relationship type - used to enforce 1:1 with unique constraint */
32
- relationshipType?: RelationshipType;
30
+ /** Relationship type - used to enforce 1:1 with unique constraint */
31
+ relationshipType?: RelationshipType;
33
32
  };
34
33
  type UpdateForeignKeyInput = {
35
- id: string;
34
+ id: string;
36
35
  } & Partial<Pick<ForeignKeyConstraintPatch, 'name' | 'fieldIds' | 'refTableId' | 'refFieldIds' | 'deleteAction' | 'updateAction'>>;
37
36
  interface DeleteForeignKeyInput {
38
- id: string;
37
+ id: string;
39
38
  }
40
- declare function useCreateForeignKey(): _tanstack_react_query.UseMutationResult<{
41
- id: string;
42
- name: string;
39
+ declare function useCreateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
40
+ id: string;
41
+ name: string;
43
42
  }, Error, CreateForeignKeyInput, unknown>;
44
- declare function useUpdateForeignKey(): _tanstack_react_query.UseMutationResult<{
45
- id: string;
46
- name: string;
43
+ declare function useUpdateForeignKey(): import("@tanstack/react-query").UseMutationResult<{
44
+ id: string;
45
+ name: string;
47
46
  }, Error, UpdateForeignKeyInput, unknown>;
48
- declare function useDeleteForeignKey(): _tanstack_react_query.UseMutationResult<{
49
- id: string;
47
+ declare function useDeleteForeignKey(): import("@tanstack/react-query").UseMutationResult<{
48
+ id: string;
50
49
  }, Error, DeleteForeignKeyInput, unknown>;
51
50
  interface CreateManyToManyInput {
52
- /** First table ID */
53
- tableAId: string;
54
- /** Second table ID */
55
- tableBId: string;
56
- /** First table name (for FK field naming) */
57
- tableAName: string;
58
- /** Second table name (for FK field naming) */
59
- tableBName: string;
60
- /** Junction table name */
61
- junctionTableName: string;
62
- /** Primary key field ID of table A */
63
- tableAPrimaryKeyFieldId: string;
64
- /** Primary key field ID of table B */
65
- tableBPrimaryKeyFieldId: string;
66
- /** FK action on delete (default: CASCADE) */
67
- deleteAction?: ForeignKeyAction;
68
- /** FK action on update (default: NO_ACTION) */
69
- updateAction?: ForeignKeyAction;
51
+ /** First table ID */
52
+ tableAId: string;
53
+ /** Second table ID */
54
+ tableBId: string;
55
+ /** First table name (for FK field naming) */
56
+ tableAName: string;
57
+ /** Second table name (for FK field naming) */
58
+ tableBName: string;
59
+ /** Junction table name */
60
+ junctionTableName: string;
61
+ /** Primary key field ID of table A */
62
+ tableAPrimaryKeyFieldId: string;
63
+ /** Primary key field ID of table B */
64
+ tableBPrimaryKeyFieldId: string;
65
+ /** FK action on delete (default: CASCADE) */
66
+ deleteAction?: ForeignKeyAction;
67
+ /** FK action on update (default: NO_ACTION) */
68
+ updateAction?: ForeignKeyAction;
70
69
  }
71
70
  /**
72
71
  * Creates a many-to-many relationship by:
@@ -76,46 +75,48 @@ interface CreateManyToManyInput {
76
75
  * 4. Creating two FK constraints
77
76
  * 5. Creating a composite unique constraint on (a_id, b_id) to prevent duplicates
78
77
  */
79
- declare function useCreateManyToMany(): _tanstack_react_query.UseMutationResult<{
80
- junctionTableId: string;
81
- junctionTableName: string;
78
+ declare function useCreateManyToMany(): import("@tanstack/react-query").UseMutationResult<{
79
+ junctionTableId: string;
80
+ junctionTableName: string;
82
81
  }, Error, CreateManyToManyInput, unknown>;
83
-
82
+ //#endregion
83
+ //#region src/schema/schema-builder-relationships/lib/gql/hooks/schema-builder/use-relation-provision.d.ts
84
84
  interface RelationProvisionInput {
85
- relationshipType: RelationshipType;
86
- sourceTableId: string;
87
- targetTableId: string;
88
- /** 'c'=CASCADE, 'r'=RESTRICT, 'n'=SET NULL. Required for FK types; M2M always cascades. */
89
- deleteAction?: ForeignKeyAction;
90
- /** FK column name (auto-derived from target table name if omitted) */
91
- fieldName?: string;
92
- /** Whether FK field is NOT NULL (default: true) */
93
- isRequired?: boolean;
94
- /** Junction table name for M2M (auto-derived if omitted) */
95
- junctionTableName?: string;
96
- /** Use composite PK on junction table (M2M only) */
97
- useCompositeKey?: boolean;
98
- /** Source FK name override (M2M only) */
99
- sourceFieldName?: string;
100
- /** Target FK name override (M2M only) */
101
- targetFieldName?: string;
102
- /** Policy type for junction table (M2M only, default: AuthzAllowAll) */
103
- policyType?: string;
104
- /** Policy config data (M2M only) */
105
- policyData?: Record<string, unknown>;
106
- /** Resolved policy type object (M2M only, used to derive data nodes) */
107
- policyTypeObj?: MergedPolicyType;
108
- /** Whether to expose this M2M relation in the GraphQL API */
109
- exposeInApi?: boolean;
85
+ relationshipType: RelationshipType;
86
+ sourceTableId: string;
87
+ targetTableId: string;
88
+ /** 'c'=CASCADE, 'r'=RESTRICT, 'n'=SET NULL. Required for FK types; M2M always cascades. */
89
+ deleteAction?: ForeignKeyAction;
90
+ /** FK column name (auto-derived from target table name if omitted) */
91
+ fieldName?: string;
92
+ /** Whether FK field is NOT NULL (default: true) */
93
+ isRequired?: boolean;
94
+ /** Junction table name for M2M (auto-derived if omitted) */
95
+ junctionTableName?: string;
96
+ /** Use composite PK on junction table (M2M only) */
97
+ useCompositeKey?: boolean;
98
+ /** Source FK name override (M2M only) */
99
+ sourceFieldName?: string;
100
+ /** Target FK name override (M2M only) */
101
+ targetFieldName?: string;
102
+ /** Policy type for junction table (M2M only, default: AuthzAllowAll) */
103
+ policyType?: string;
104
+ /** Policy config data (M2M only) */
105
+ policyData?: Record<string, unknown>;
106
+ /** Resolved policy type object (M2M only, used to derive data nodes) */
107
+ policyTypeObj?: MergedPolicyType;
108
+ /** Whether to expose this M2M relation in the GraphQL API */
109
+ exposeInApi?: boolean;
110
110
  }
111
111
  interface RelationProvisionResult {
112
- outFieldId: string | null;
113
- outJunctionTableId: string | null;
114
- outSourceFieldId: string | null;
115
- outTargetFieldId: string | null;
112
+ outFieldId: string | null;
113
+ outJunctionTableId: string | null;
114
+ outSourceFieldId: string | null;
115
+ outTargetFieldId: string | null;
116
116
  }
117
117
  declare function useRelationProvision(options?: {
118
- skipTableSelect?: boolean;
119
- }): _tanstack_react_query.UseMutationResult<RelationProvisionResult, Error, RelationProvisionInput, unknown>;
120
-
121
- export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
118
+ skipTableSelect?: boolean;
119
+ }): import("@tanstack/react-query").UseMutationResult<RelationProvisionResult, Error, RelationProvisionInput, unknown>;
120
+ //#endregion
121
+ export { type CreateForeignKeyInput, type CreateManyToManyInput, type DeleteForeignKeyInput, type ForeignKeyConstraintInput, type ForeignKeyConstraintPatch, RelationshipsView, type SchemaBuilderRelationshipsCapabilities, type UpdateForeignKeyInput, useCreateForeignKey, useCreateManyToMany, useDeleteForeignKey, useRelationProvision, useUpdateForeignKey };
122
+ //# sourceMappingURL=relationships.d.ts.map