@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,199 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- interface SchemaBuilderScope {
4
- orgId: string;
5
- databaseId: string;
6
- userId?: string | null;
7
- }
8
- type SchemaBuilderColorMode = 'light' | 'dark';
9
- interface SchemaBuilderSidebarSections {
10
- app: boolean;
11
- system: boolean;
12
- }
13
- interface SchemaBuilderPreferences {
14
- sidebarSectionsExpanded: SchemaBuilderSidebarSections;
15
- showSystemTablesInSidebar: boolean;
16
- showSystemTablesInVisualizer: boolean;
17
- sidebarPinned: boolean;
18
- typesLibraryExpanded: boolean;
19
- }
20
- declare const DEFAULT_SCHEMA_BUILDER_PREFERENCES: Readonly<SchemaBuilderPreferences>;
21
- interface SchemaBuilderField {
22
- id: string;
23
- name: string;
24
- type?: string | null;
25
- description?: string | null;
26
- isNullable?: boolean | null;
27
- isPrimaryKey?: boolean | null;
28
- isUnique?: boolean | null;
29
- [key: string]: unknown;
30
- }
31
- interface SchemaBuilderTable {
32
- id: string;
33
- name: string;
34
- label?: string | null;
35
- description?: string | null;
36
- category?: string | null;
37
- schemaId?: string | null;
38
- fields?: readonly SchemaBuilderField[];
39
- [key: string]: unknown;
40
- }
41
- interface SchemaBuilderSchema {
42
- id: string;
43
- name: string;
44
- label?: string | null;
45
- tables?: readonly SchemaBuilderTable[];
46
- [key: string]: unknown;
47
- }
48
- interface SchemaBuilderIndex {
49
- id: string;
50
- name: string;
51
- tableId?: string | null;
52
- fieldIds?: readonly string[];
53
- isUnique?: boolean | null;
54
- [key: string]: unknown;
55
- }
56
- interface SchemaBuilderPolicy {
57
- id: string;
58
- name: string;
59
- tableId?: string | null;
60
- command?: string | null;
61
- [key: string]: unknown;
62
- }
63
- interface SchemaBuilderRelationship {
64
- id: string;
65
- sourceTableId?: string | null;
66
- targetTableId?: string | null;
67
- [key: string]: unknown;
68
- }
69
- interface SchemaBuilderOperationContext {
70
- scope: SchemaBuilderScope;
71
- signal?: AbortSignal;
72
- /** Generated-SDK registry adapters forward requested result fields here. */
73
- selection?: Readonly<Record<string, unknown>>;
74
- }
75
- type SchemaBuilderVariables = object;
76
- type SchemaBuilderOperation<TVariables extends SchemaBuilderVariables = SchemaBuilderVariables, TResult = unknown> = (variables: TVariables, context: SchemaBuilderOperationContext) => Promise<TResult>;
77
- type SchemaBuilderCollection<T> = readonly T[] | {
78
- nodes?: readonly T[] | null;
79
- totalCount?: number | null;
80
- };
81
- interface SchemaBuilderCoreCapabilities {
82
- apiSchemas: SchemaBuilderOperation;
83
- apis: SchemaBuilderOperation;
84
- databases: SchemaBuilderOperation;
85
- fields: SchemaBuilderOperation;
86
- foreignKeyConstraints: SchemaBuilderOperation;
87
- indices: SchemaBuilderOperation;
88
- policies: SchemaBuilderOperation;
89
- primaryKeyConstraints: SchemaBuilderOperation;
90
- schemas: SchemaBuilderOperation;
91
- table: SchemaBuilderOperation;
92
- tables: SchemaBuilderOperation;
93
- uniqueConstraints: SchemaBuilderOperation;
94
- users: SchemaBuilderOperation;
95
- }
96
- interface SchemaBuilderFieldsCapabilities {
97
- createField: SchemaBuilderOperation;
98
- createPrimaryKeyConstraint: SchemaBuilderOperation;
99
- createUniqueConstraint: SchemaBuilderOperation;
100
- deleteField: SchemaBuilderOperation;
101
- deletePrimaryKeyConstraint: SchemaBuilderOperation;
102
- deleteUniqueConstraint: SchemaBuilderOperation;
103
- updateField: SchemaBuilderOperation;
104
- updatePrimaryKeyConstraint: SchemaBuilderOperation;
105
- }
106
- interface SchemaBuilderRelationshipsCapabilities {
107
- createField: SchemaBuilderOperation;
108
- createForeignKeyConstraint: SchemaBuilderOperation;
109
- createPrimaryKeyConstraint: SchemaBuilderOperation;
110
- createRelationProvision: SchemaBuilderOperation;
111
- createTable: SchemaBuilderOperation;
112
- createUniqueConstraint: SchemaBuilderOperation;
113
- deleteForeignKeyConstraint: SchemaBuilderOperation;
114
- relationProvisions: SchemaBuilderOperation;
115
- updateForeignKeyConstraint: SchemaBuilderOperation;
116
- }
117
- interface SchemaBuilderIndexesCapabilities {
118
- createIndex: SchemaBuilderOperation;
119
- deleteIndex: SchemaBuilderOperation;
120
- updateIndex: SchemaBuilderOperation;
121
- }
122
- interface SchemaBuilderPoliciesCapabilities {
123
- appPermissions: SchemaBuilderOperation;
124
- createField: SchemaBuilderOperation;
125
- createSecureTableProvision: SchemaBuilderOperation;
126
- createTable: SchemaBuilderOperation;
127
- createTableGrant: SchemaBuilderOperation;
128
- deletePolicy: SchemaBuilderOperation;
129
- fields: SchemaBuilderOperation;
130
- orgPermissions: SchemaBuilderOperation;
131
- tables: SchemaBuilderOperation;
132
- updatePolicy: SchemaBuilderOperation;
133
- }
134
- interface SchemaBuilderTablesCapabilities {
135
- deleteTable: SchemaBuilderOperation;
136
- updateTable: SchemaBuilderOperation;
137
- }
138
- /**
139
- * Imperative data boundary owned by the host. Each feature is isolated so a
140
- * partial registry install can provide only the capabilities it consumes.
141
- */
142
- interface SchemaBuilderAdapter {
143
- core: SchemaBuilderCoreCapabilities;
144
- fields: SchemaBuilderFieldsCapabilities;
145
- relationships: SchemaBuilderRelationshipsCapabilities;
146
- indexes: SchemaBuilderIndexesCapabilities;
147
- policies: SchemaBuilderPoliciesCapabilities;
148
- tables: SchemaBuilderTablesCapabilities;
149
- }
150
- type SchemaBuilderFeature = keyof SchemaBuilderAdapter;
151
- type SchemaBuilderCoreTabId = 'editor' | 'relationships' | 'indexes' | 'security';
152
- interface SchemaBuilderNavigationTarget {
153
- href: string;
154
- replace?: boolean;
155
- }
156
- interface SchemaBuilderTableSelection {
157
- tableId: string | null;
158
- tableName: string | null;
159
- }
160
- interface SchemaBuilderTabRenderContext {
161
- scope: SchemaBuilderScope;
162
- colorMode: SchemaBuilderColorMode;
163
- selectedTableId: string | null;
164
- }
165
- interface SchemaBuilderTab {
166
- id: string;
167
- label: ReactNode;
168
- render: (context: SchemaBuilderTabRenderContext) => ReactNode;
169
- preload?: () => void | Promise<void>;
170
- /** Keeps the tab addressable without showing it in the package-owned tab list. */
171
- hidden?: boolean;
172
- }
173
- interface SchemaBuilderInvalidationEvent {
174
- scope: SchemaBuilderScope;
175
- feature: SchemaBuilderFeature;
176
- operation: string;
177
- }
178
- interface SchemaBuilderHostOptions {
179
- adapter: SchemaBuilderAdapter;
180
- scope: SchemaBuilderScope;
181
- colorMode: SchemaBuilderColorMode;
182
- preferences: SchemaBuilderPreferences;
183
- onPreferencesChange: (preferences: SchemaBuilderPreferences) => void;
184
- activeTab: string;
185
- onActiveTabChange: (tabId: string) => void;
186
- /** Optional host-controlled table selection, such as a URL-backed table id. */
187
- selectedTableId?: string | null;
188
- onSelectedTableChange?: (selection: SchemaBuilderTableSelection) => void;
189
- onNavigate?: (target: SchemaBuilderNavigationTarget) => void;
190
- onInvalidate?: (event: SchemaBuilderInvalidationEvent) => void;
191
- tabs?: readonly SchemaBuilderTab[];
192
- }
193
- interface SchemaBuilderProps extends SchemaBuilderHostOptions {
194
- className?: string;
195
- emptyState?: ReactNode;
196
- }
197
- declare function defineSchemaBuilderAdapter<TAdapter extends SchemaBuilderAdapter>(adapter: TAdapter): TAdapter;
198
-
199
- export { type SchemaBuilderTableSelection as A, type SchemaBuilderTablesCapabilities as B, type SchemaBuilderVariables as C, DEFAULT_SCHEMA_BUILDER_PREFERENCES as D, defineSchemaBuilderAdapter as E, type SchemaBuilderProps as S, type SchemaBuilderAdapter as a, type SchemaBuilderCollection as b, type SchemaBuilderColorMode as c, type SchemaBuilderCoreCapabilities as d, type SchemaBuilderCoreTabId as e, type SchemaBuilderFeature as f, type SchemaBuilderField as g, type SchemaBuilderFieldsCapabilities as h, type SchemaBuilderHostOptions as i, type SchemaBuilderIndex as j, type SchemaBuilderIndexesCapabilities as k, type SchemaBuilderInvalidationEvent as l, type SchemaBuilderNavigationTarget as m, type SchemaBuilderOperation as n, type SchemaBuilderOperationContext as o, type SchemaBuilderPoliciesCapabilities as p, type SchemaBuilderPolicy as q, type SchemaBuilderPreferences as r, type SchemaBuilderRelationship as s, type SchemaBuilderRelationshipsCapabilities as t, type SchemaBuilderSchema as u, type SchemaBuilderScope as v, type SchemaBuilderSidebarSections as w, type SchemaBuilderTab as x, type SchemaBuilderTabRenderContext as y, type SchemaBuilderTable as z };
@@ -1,199 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- interface SchemaBuilderScope {
4
- orgId: string;
5
- databaseId: string;
6
- userId?: string | null;
7
- }
8
- type SchemaBuilderColorMode = 'light' | 'dark';
9
- interface SchemaBuilderSidebarSections {
10
- app: boolean;
11
- system: boolean;
12
- }
13
- interface SchemaBuilderPreferences {
14
- sidebarSectionsExpanded: SchemaBuilderSidebarSections;
15
- showSystemTablesInSidebar: boolean;
16
- showSystemTablesInVisualizer: boolean;
17
- sidebarPinned: boolean;
18
- typesLibraryExpanded: boolean;
19
- }
20
- declare const DEFAULT_SCHEMA_BUILDER_PREFERENCES: Readonly<SchemaBuilderPreferences>;
21
- interface SchemaBuilderField {
22
- id: string;
23
- name: string;
24
- type?: string | null;
25
- description?: string | null;
26
- isNullable?: boolean | null;
27
- isPrimaryKey?: boolean | null;
28
- isUnique?: boolean | null;
29
- [key: string]: unknown;
30
- }
31
- interface SchemaBuilderTable {
32
- id: string;
33
- name: string;
34
- label?: string | null;
35
- description?: string | null;
36
- category?: string | null;
37
- schemaId?: string | null;
38
- fields?: readonly SchemaBuilderField[];
39
- [key: string]: unknown;
40
- }
41
- interface SchemaBuilderSchema {
42
- id: string;
43
- name: string;
44
- label?: string | null;
45
- tables?: readonly SchemaBuilderTable[];
46
- [key: string]: unknown;
47
- }
48
- interface SchemaBuilderIndex {
49
- id: string;
50
- name: string;
51
- tableId?: string | null;
52
- fieldIds?: readonly string[];
53
- isUnique?: boolean | null;
54
- [key: string]: unknown;
55
- }
56
- interface SchemaBuilderPolicy {
57
- id: string;
58
- name: string;
59
- tableId?: string | null;
60
- command?: string | null;
61
- [key: string]: unknown;
62
- }
63
- interface SchemaBuilderRelationship {
64
- id: string;
65
- sourceTableId?: string | null;
66
- targetTableId?: string | null;
67
- [key: string]: unknown;
68
- }
69
- interface SchemaBuilderOperationContext {
70
- scope: SchemaBuilderScope;
71
- signal?: AbortSignal;
72
- /** Generated-SDK registry adapters forward requested result fields here. */
73
- selection?: Readonly<Record<string, unknown>>;
74
- }
75
- type SchemaBuilderVariables = object;
76
- type SchemaBuilderOperation<TVariables extends SchemaBuilderVariables = SchemaBuilderVariables, TResult = unknown> = (variables: TVariables, context: SchemaBuilderOperationContext) => Promise<TResult>;
77
- type SchemaBuilderCollection<T> = readonly T[] | {
78
- nodes?: readonly T[] | null;
79
- totalCount?: number | null;
80
- };
81
- interface SchemaBuilderCoreCapabilities {
82
- apiSchemas: SchemaBuilderOperation;
83
- apis: SchemaBuilderOperation;
84
- databases: SchemaBuilderOperation;
85
- fields: SchemaBuilderOperation;
86
- foreignKeyConstraints: SchemaBuilderOperation;
87
- indices: SchemaBuilderOperation;
88
- policies: SchemaBuilderOperation;
89
- primaryKeyConstraints: SchemaBuilderOperation;
90
- schemas: SchemaBuilderOperation;
91
- table: SchemaBuilderOperation;
92
- tables: SchemaBuilderOperation;
93
- uniqueConstraints: SchemaBuilderOperation;
94
- users: SchemaBuilderOperation;
95
- }
96
- interface SchemaBuilderFieldsCapabilities {
97
- createField: SchemaBuilderOperation;
98
- createPrimaryKeyConstraint: SchemaBuilderOperation;
99
- createUniqueConstraint: SchemaBuilderOperation;
100
- deleteField: SchemaBuilderOperation;
101
- deletePrimaryKeyConstraint: SchemaBuilderOperation;
102
- deleteUniqueConstraint: SchemaBuilderOperation;
103
- updateField: SchemaBuilderOperation;
104
- updatePrimaryKeyConstraint: SchemaBuilderOperation;
105
- }
106
- interface SchemaBuilderRelationshipsCapabilities {
107
- createField: SchemaBuilderOperation;
108
- createForeignKeyConstraint: SchemaBuilderOperation;
109
- createPrimaryKeyConstraint: SchemaBuilderOperation;
110
- createRelationProvision: SchemaBuilderOperation;
111
- createTable: SchemaBuilderOperation;
112
- createUniqueConstraint: SchemaBuilderOperation;
113
- deleteForeignKeyConstraint: SchemaBuilderOperation;
114
- relationProvisions: SchemaBuilderOperation;
115
- updateForeignKeyConstraint: SchemaBuilderOperation;
116
- }
117
- interface SchemaBuilderIndexesCapabilities {
118
- createIndex: SchemaBuilderOperation;
119
- deleteIndex: SchemaBuilderOperation;
120
- updateIndex: SchemaBuilderOperation;
121
- }
122
- interface SchemaBuilderPoliciesCapabilities {
123
- appPermissions: SchemaBuilderOperation;
124
- createField: SchemaBuilderOperation;
125
- createSecureTableProvision: SchemaBuilderOperation;
126
- createTable: SchemaBuilderOperation;
127
- createTableGrant: SchemaBuilderOperation;
128
- deletePolicy: SchemaBuilderOperation;
129
- fields: SchemaBuilderOperation;
130
- orgPermissions: SchemaBuilderOperation;
131
- tables: SchemaBuilderOperation;
132
- updatePolicy: SchemaBuilderOperation;
133
- }
134
- interface SchemaBuilderTablesCapabilities {
135
- deleteTable: SchemaBuilderOperation;
136
- updateTable: SchemaBuilderOperation;
137
- }
138
- /**
139
- * Imperative data boundary owned by the host. Each feature is isolated so a
140
- * partial registry install can provide only the capabilities it consumes.
141
- */
142
- interface SchemaBuilderAdapter {
143
- core: SchemaBuilderCoreCapabilities;
144
- fields: SchemaBuilderFieldsCapabilities;
145
- relationships: SchemaBuilderRelationshipsCapabilities;
146
- indexes: SchemaBuilderIndexesCapabilities;
147
- policies: SchemaBuilderPoliciesCapabilities;
148
- tables: SchemaBuilderTablesCapabilities;
149
- }
150
- type SchemaBuilderFeature = keyof SchemaBuilderAdapter;
151
- type SchemaBuilderCoreTabId = 'editor' | 'relationships' | 'indexes' | 'security';
152
- interface SchemaBuilderNavigationTarget {
153
- href: string;
154
- replace?: boolean;
155
- }
156
- interface SchemaBuilderTableSelection {
157
- tableId: string | null;
158
- tableName: string | null;
159
- }
160
- interface SchemaBuilderTabRenderContext {
161
- scope: SchemaBuilderScope;
162
- colorMode: SchemaBuilderColorMode;
163
- selectedTableId: string | null;
164
- }
165
- interface SchemaBuilderTab {
166
- id: string;
167
- label: ReactNode;
168
- render: (context: SchemaBuilderTabRenderContext) => ReactNode;
169
- preload?: () => void | Promise<void>;
170
- /** Keeps the tab addressable without showing it in the package-owned tab list. */
171
- hidden?: boolean;
172
- }
173
- interface SchemaBuilderInvalidationEvent {
174
- scope: SchemaBuilderScope;
175
- feature: SchemaBuilderFeature;
176
- operation: string;
177
- }
178
- interface SchemaBuilderHostOptions {
179
- adapter: SchemaBuilderAdapter;
180
- scope: SchemaBuilderScope;
181
- colorMode: SchemaBuilderColorMode;
182
- preferences: SchemaBuilderPreferences;
183
- onPreferencesChange: (preferences: SchemaBuilderPreferences) => void;
184
- activeTab: string;
185
- onActiveTabChange: (tabId: string) => void;
186
- /** Optional host-controlled table selection, such as a URL-backed table id. */
187
- selectedTableId?: string | null;
188
- onSelectedTableChange?: (selection: SchemaBuilderTableSelection) => void;
189
- onNavigate?: (target: SchemaBuilderNavigationTarget) => void;
190
- onInvalidate?: (event: SchemaBuilderInvalidationEvent) => void;
191
- tabs?: readonly SchemaBuilderTab[];
192
- }
193
- interface SchemaBuilderProps extends SchemaBuilderHostOptions {
194
- className?: string;
195
- emptyState?: ReactNode;
196
- }
197
- declare function defineSchemaBuilderAdapter<TAdapter extends SchemaBuilderAdapter>(adapter: TAdapter): TAdapter;
198
-
199
- export { type SchemaBuilderTableSelection as A, type SchemaBuilderTablesCapabilities as B, type SchemaBuilderVariables as C, DEFAULT_SCHEMA_BUILDER_PREFERENCES as D, defineSchemaBuilderAdapter as E, type SchemaBuilderProps as S, type SchemaBuilderAdapter as a, type SchemaBuilderCollection as b, type SchemaBuilderColorMode as c, type SchemaBuilderCoreCapabilities as d, type SchemaBuilderCoreTabId as e, type SchemaBuilderFeature as f, type SchemaBuilderField as g, type SchemaBuilderFieldsCapabilities as h, type SchemaBuilderHostOptions as i, type SchemaBuilderIndex as j, type SchemaBuilderIndexesCapabilities as k, type SchemaBuilderInvalidationEvent as l, type SchemaBuilderNavigationTarget as m, type SchemaBuilderOperation as n, type SchemaBuilderOperationContext as o, type SchemaBuilderPoliciesCapabilities as p, type SchemaBuilderPolicy as q, type SchemaBuilderPreferences as r, type SchemaBuilderRelationship as s, type SchemaBuilderRelationshipsCapabilities as t, type SchemaBuilderSchema as u, type SchemaBuilderScope as v, type SchemaBuilderSidebarSections as w, type SchemaBuilderTab as x, type SchemaBuilderTabRenderContext as y, type SchemaBuilderTable as z };
@@ -1,52 +0,0 @@
1
- type CellType = 'text' | 'textarea' | 'email' | 'url' | 'phone' | 'citext' | 'bpchar' | 'number' | 'integer' | 'smallint' | 'decimal' | 'currency' | 'percentage' | 'date' | 'datetime' | 'time' | 'timestamptz' | 'interval' | 'boolean' | 'toggle' | 'bit' | 'json' | 'jsonb' | 'array' | 'text-array' | 'uuid-array' | 'number-array' | 'integer-array' | 'date-array' | 'geometry' | 'geometry-point' | 'geometry-collection' | 'inet' | 'image' | 'file' | 'video' | 'audio' | 'upload' | 'uuid' | 'color' | 'rating' | 'tags' | 'tsvector' | 'origin' | 'relation' | 'unknown';
2
-
3
- declare const RelationshipTypes: {
4
- readonly ONE_TO_ONE: "one-to-one";
5
- readonly BELONGS_TO: "belongs-to";
6
- readonly ONE_TO_MANY: "one-to-many";
7
- readonly MANY_TO_MANY: "many-to-many";
8
- };
9
- declare const ForeignKeyActions: {
10
- readonly CASCADE: "c";
11
- readonly RESTRICT: "r";
12
- readonly SET_NULL: "n";
13
- readonly SET_DEFAULT: "d";
14
- readonly NO_ACTION: "a";
15
- };
16
- type RelationshipType = (typeof RelationshipTypes)[keyof typeof RelationshipTypes];
17
- type ForeignKeyAction = (typeof ForeignKeyActions)[keyof typeof ForeignKeyActions];
18
- interface FieldConstraints {
19
- nullable?: boolean;
20
- unique?: boolean;
21
- primaryKey?: boolean;
22
- defaultValue?: string | number | boolean | null;
23
- minLength?: number;
24
- maxLength?: number;
25
- minValue?: number;
26
- maxValue?: number;
27
- pattern?: string;
28
- enumValues?: string[];
29
- precision?: number;
30
- scale?: number;
31
- checkExpression?: string;
32
- }
33
- interface FieldDefinition {
34
- id: string;
35
- name: string;
36
- type: CellType;
37
- label?: string;
38
- description?: string;
39
- constraints: FieldConstraints;
40
- fieldOrder?: number;
41
- isHidden?: boolean;
42
- isRequired?: boolean;
43
- metadata?: {
44
- elementType?: CellType;
45
- targetTable?: string;
46
- targetField?: string;
47
- geoType?: 'Point' | 'Polygon' | 'LineString' | 'MultiPoint' | 'MultiPolygon' | 'MultiLineString';
48
- smartTags?: Record<string, unknown> | null;
49
- };
50
- }
51
-
52
- export type { FieldDefinition as F, RelationshipType as R, ForeignKeyAction as a };
@@ -1,52 +0,0 @@
1
- type CellType = 'text' | 'textarea' | 'email' | 'url' | 'phone' | 'citext' | 'bpchar' | 'number' | 'integer' | 'smallint' | 'decimal' | 'currency' | 'percentage' | 'date' | 'datetime' | 'time' | 'timestamptz' | 'interval' | 'boolean' | 'toggle' | 'bit' | 'json' | 'jsonb' | 'array' | 'text-array' | 'uuid-array' | 'number-array' | 'integer-array' | 'date-array' | 'geometry' | 'geometry-point' | 'geometry-collection' | 'inet' | 'image' | 'file' | 'video' | 'audio' | 'upload' | 'uuid' | 'color' | 'rating' | 'tags' | 'tsvector' | 'origin' | 'relation' | 'unknown';
2
-
3
- declare const RelationshipTypes: {
4
- readonly ONE_TO_ONE: "one-to-one";
5
- readonly BELONGS_TO: "belongs-to";
6
- readonly ONE_TO_MANY: "one-to-many";
7
- readonly MANY_TO_MANY: "many-to-many";
8
- };
9
- declare const ForeignKeyActions: {
10
- readonly CASCADE: "c";
11
- readonly RESTRICT: "r";
12
- readonly SET_NULL: "n";
13
- readonly SET_DEFAULT: "d";
14
- readonly NO_ACTION: "a";
15
- };
16
- type RelationshipType = (typeof RelationshipTypes)[keyof typeof RelationshipTypes];
17
- type ForeignKeyAction = (typeof ForeignKeyActions)[keyof typeof ForeignKeyActions];
18
- interface FieldConstraints {
19
- nullable?: boolean;
20
- unique?: boolean;
21
- primaryKey?: boolean;
22
- defaultValue?: string | number | boolean | null;
23
- minLength?: number;
24
- maxLength?: number;
25
- minValue?: number;
26
- maxValue?: number;
27
- pattern?: string;
28
- enumValues?: string[];
29
- precision?: number;
30
- scale?: number;
31
- checkExpression?: string;
32
- }
33
- interface FieldDefinition {
34
- id: string;
35
- name: string;
36
- type: CellType;
37
- label?: string;
38
- description?: string;
39
- constraints: FieldConstraints;
40
- fieldOrder?: number;
41
- isHidden?: boolean;
42
- isRequired?: boolean;
43
- metadata?: {
44
- elementType?: CellType;
45
- targetTable?: string;
46
- targetField?: string;
47
- geoType?: 'Point' | 'Polygon' | 'LineString' | 'MultiPoint' | 'MultiPolygon' | 'MultiLineString';
48
- smartTags?: Record<string, unknown> | null;
49
- };
50
- }
51
-
52
- export type { FieldDefinition as F, RelationshipType as R, ForeignKeyAction as a };