@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.
Files changed (130) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +12 -4
  3. package/dist/card-widths-CmIxkRfh.cjs +28 -0
  4. package/dist/card-widths-CmIxkRfh.cjs.map +1 -0
  5. package/dist/card-widths-pI4Kw4Xz.js +22 -0
  6. package/dist/card-widths-pI4Kw4Xz.js.map +1 -0
  7. package/dist/core-CVxnNLs7.cjs +66 -0
  8. package/dist/core-CVxnNLs7.cjs.map +1 -0
  9. package/dist/core-DJ5kA4r-.js +49 -0
  10. package/dist/core-DJ5kA4r-.js.map +1 -0
  11. package/dist/core.cjs +14 -212
  12. package/dist/core.d.cts +3 -54
  13. package/dist/core.d.ts +3 -54
  14. package/dist/core.js +3 -200
  15. package/dist/create-table-card-B6SMrt_g.js +7691 -0
  16. package/dist/create-table-card-B6SMrt_g.js.map +1 -0
  17. package/dist/create-table-card-BrQ7pB_U.cjs +7732 -0
  18. package/dist/create-table-card-BrQ7pB_U.cjs.map +1 -0
  19. package/dist/delete-confirm-dialog-Ch4tWj6B.cjs +42 -0
  20. package/dist/delete-confirm-dialog-Ch4tWj6B.cjs.map +1 -0
  21. package/dist/delete-confirm-dialog-K0AWE643.js +37 -0
  22. package/dist/delete-confirm-dialog-K0AWE643.js.map +1 -0
  23. package/dist/empty-state-card-5t7LygTB.cjs +62 -0
  24. package/dist/empty-state-card-5t7LygTB.cjs.map +1 -0
  25. package/dist/empty-state-card-C-Nylatg.js +57 -0
  26. package/dist/empty-state-card-C-Nylatg.js.map +1 -0
  27. package/dist/fields.cjs +8 -7763
  28. package/dist/fields.d.cts +38 -39
  29. package/dist/fields.d.ts +38 -39
  30. package/dist/fields.js +2 -7735
  31. package/dist/generated-types-DZMUyNBH.d.cts +27 -0
  32. package/dist/generated-types-DZMUyNBH.d.ts +27 -0
  33. package/dist/index--9KTz1LB.d.cts +56 -0
  34. package/dist/index-10idAfdb.d.cts +7 -0
  35. package/dist/index-BcdFaKFS.d.ts +7 -0
  36. package/dist/index-euaSKMQK.d.ts +56 -0
  37. package/dist/index.cjs +392 -13730
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +4 -10
  40. package/dist/index.d.ts +4 -10
  41. package/dist/index.js +381 -13698
  42. package/dist/index.js.map +1 -1
  43. package/dist/indexes-view-CBzYpKcd.js +736 -0
  44. package/dist/indexes-view-CBzYpKcd.js.map +1 -0
  45. package/dist/indexes-view-D1K24ts1.cjs +759 -0
  46. package/dist/indexes-view-D1K24ts1.cjs.map +1 -0
  47. package/dist/indexes.cjs +6 -1041
  48. package/dist/indexes.d.cts +27 -27
  49. package/dist/indexes.d.ts +27 -27
  50. package/dist/indexes.js +2 -1016
  51. package/dist/invalidate-database-entities-BFCWf5Zf.js +2561 -0
  52. package/dist/invalidate-database-entities-BFCWf5Zf.js.map +1 -0
  53. package/dist/invalidate-database-entities-Gs5k8A-M.cjs +2864 -0
  54. package/dist/invalidate-database-entities-Gs5k8A-M.cjs.map +1 -0
  55. package/dist/keyboard-activation-BQiV0scm.js +13 -0
  56. package/dist/keyboard-activation-BQiV0scm.js.map +1 -0
  57. package/dist/keyboard-activation-D-L0IU6Y.cjs +19 -0
  58. package/dist/keyboard-activation-D-L0IU6Y.cjs.map +1 -0
  59. package/dist/policies-view-CkvGpJBo.cjs +1023 -0
  60. package/dist/policies-view-CkvGpJBo.cjs.map +1 -0
  61. package/dist/policies-view-DTfAhX7G.js +1018 -0
  62. package/dist/policies-view-DTfAhX7G.js.map +1 -0
  63. package/dist/policies.cjs +10 -5939
  64. package/dist/policies.d.cts +55 -50
  65. package/dist/policies.d.ts +55 -50
  66. package/dist/policies.js +4 -5911
  67. package/dist/policy-config-form-EEcQ9ywL.js +2502 -0
  68. package/dist/policy-config-form-EEcQ9ywL.js.map +1 -0
  69. package/dist/policy-config-form-RP9010zj.cjs +2629 -0
  70. package/dist/policy-config-form-RP9010zj.cjs.map +1 -0
  71. package/dist/policy-types-D_sYWb-b.d.cts +81 -0
  72. package/dist/policy-types-D_sYWb-b.d.ts +81 -0
  73. package/dist/query-BGtzUV7Y.cjs +233 -0
  74. package/dist/query-BGtzUV7Y.cjs.map +1 -0
  75. package/dist/query-r6j8IjQB.js +192 -0
  76. package/dist/query-r6j8IjQB.js.map +1 -0
  77. package/dist/relationships-view-C884EvGj.js +2417 -0
  78. package/dist/relationships-view-C884EvGj.js.map +1 -0
  79. package/dist/relationships-view-DlBs-gCF.cjs +2452 -0
  80. package/dist/relationships-view-DlBs-gCF.cjs.map +1 -0
  81. package/dist/relationships.cjs +9 -4328
  82. package/dist/relationships.d.cts +92 -92
  83. package/dist/relationships.d.ts +92 -92
  84. package/dist/relationships.js +2 -4300
  85. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  86. package/dist/schema-builder-sidebar-DAgK7ZTu.js +654 -0
  87. package/dist/schema-builder-sidebar-DAgK7ZTu.js.map +1 -0
  88. package/dist/schema-builder-sidebar-L3TcQeQr.cjs +671 -0
  89. package/dist/schema-builder-sidebar-L3TcQeQr.cjs.map +1 -0
  90. package/dist/table-editor-B-5i1M79.js +1906 -0
  91. package/dist/table-editor-B-5i1M79.js.map +1 -0
  92. package/dist/table-editor-BdLdVZfh.cjs +1935 -0
  93. package/dist/table-editor-BdLdVZfh.cjs.map +1 -0
  94. package/dist/tables.cjs +6 -5643
  95. package/dist/tables.d.cts +22 -21
  96. package/dist/tables.d.ts +22 -21
  97. package/dist/tables.js +3 -5618
  98. package/dist/testing.cjs +63 -62
  99. package/dist/testing.cjs.map +1 -1
  100. package/dist/testing.d.cts +4 -4
  101. package/dist/testing.d.ts +4 -4
  102. package/dist/testing.js +62 -61
  103. package/dist/testing.js.map +1 -1
  104. package/dist/types-CXNRA22N.d.cts +450 -0
  105. package/dist/types-CXNRA22N.d.ts +450 -0
  106. package/dist/use-update-table-DlLX9fdE.js +244 -0
  107. package/dist/use-update-table-DlLX9fdE.js.map +1 -0
  108. package/dist/use-update-table-vcoHVolI.cjs +291 -0
  109. package/dist/use-update-table-vcoHVolI.cjs.map +1 -0
  110. package/package.json +8 -6
  111. package/dist/core.cjs.map +0 -1
  112. package/dist/core.js.map +0 -1
  113. package/dist/fields.cjs.map +0 -1
  114. package/dist/fields.js.map +0 -1
  115. package/dist/generated-types-CnAlqHU_.d.cts +0 -25
  116. package/dist/generated-types-CnAlqHU_.d.ts +0 -25
  117. package/dist/indexes.cjs.map +0 -1
  118. package/dist/indexes.js.map +0 -1
  119. package/dist/policies.cjs.map +0 -1
  120. package/dist/policies.js.map +0 -1
  121. package/dist/policy-types-CEYAR5TN.d.cts +0 -79
  122. package/dist/policy-types-CEYAR5TN.d.ts +0 -79
  123. package/dist/relationships.cjs.map +0 -1
  124. package/dist/relationships.js.map +0 -1
  125. package/dist/tables.cjs.map +0 -1
  126. package/dist/tables.js.map +0 -1
  127. package/dist/types-Du86atZ8.d.cts +0 -199
  128. package/dist/types-Du86atZ8.d.ts +0 -199
  129. package/dist/types-bX2dCrdl.d.cts +0 -52
  130. package/dist/types-bX2dCrdl.d.ts +0 -52
@@ -1,57 +1,61 @@
1
- import * as react from 'react';
2
- import { CardComponent } from '@constructive-io/ui/stack';
3
- import { C as CrudOperation } from './policy-types-CEYAR5TN.cjs';
4
- import * as _tanstack_react_query from '@tanstack/react-query';
5
- import { a as GeneratedMutationResult } from './generated-types-CnAlqHU_.cjs';
6
- export { p as SchemaBuilderPoliciesCapabilities } from './types-Du86atZ8.cjs';
7
- import 'lucide-react';
8
-
9
- declare function PoliciesView(): react.JSX.Element;
10
-
1
+ import { _ as SchemaBuilderPoliciesCapabilities } from "./types-CXNRA22N.cjs";
2
+ import "./index--9KTz1LB.cjs";
3
+ import { t as GeneratedMutationResult } from "./generated-types-DZMUyNBH.cjs";
4
+ import "./index-10idAfdb.cjs";
5
+ import { t as CrudOperation } from "./policy-types-D_sYWb-b.cjs";
6
+ import { ReactNode } from "react";
7
+ import { UseMutationResult } from "@tanstack/react-query";
8
+ import { CardComponent } from "@constructive-io/ui/stack";
9
+ //#region src/schema/schema-builder-policies/components/table-editor/policies/policies-view.d.ts
10
+ declare function PoliciesView(): import("react").JSX.Element;
11
+ //#endregion
12
+ //#region src/schema/schema-builder-policies/components/policies/policy-config-card.d.ts
11
13
  interface TablePolicyConfigCardProps {
12
- /** If provided, skip table creation and create policies for this existing table */
13
- tableId?: string;
14
- tableName: string;
15
- selectedPolicyType: string;
16
- /** Pre-select only this operation in the config step */
17
- preSelectedOperation?: CrudOperation;
18
- onTableCreated?: (table: {
19
- id: string;
20
- name: string;
21
- }) => void;
22
- /** Called when policies are created for an existing table (when tableId is provided) */
23
- onPoliciesCreated?: () => void;
24
- onComplete?: () => void;
14
+ /** If provided, skip table creation and create policies for this existing table */
15
+ tableId?: string;
16
+ tableName: string;
17
+ selectedPolicyType: string;
18
+ /** Pre-select only this operation in the config step */
19
+ preSelectedOperation?: CrudOperation;
20
+ onTableCreated?: (table: {
21
+ id: string;
22
+ name: string;
23
+ }) => void;
24
+ /** Called when policies are created for an existing table (when tableId is provided) */
25
+ onPoliciesCreated?: () => void;
26
+ onComplete?: () => void;
25
27
  }
26
28
  /**
27
29
  * Config card for table policy settings.
28
30
  * Shows access rule config and creates all 4 CRUD operation policies by default.
29
31
  */
30
32
  declare const TablePolicyConfigCard: CardComponent<TablePolicyConfigCardProps>;
31
-
33
+ //#endregion
34
+ //#region src/schema/schema-builder-policies/lib/gql/hooks/schema-builder/policies/use-permissions.d.ts
32
35
  interface PermissionNode {
33
- bitnum: number | null;
34
- bitstr: string | null;
35
- description: string | null;
36
- id: string;
37
- name: string;
36
+ bitnum: number | null;
37
+ bitstr: string | null;
38
+ description: string | null;
39
+ id: string;
40
+ name: string;
38
41
  }
39
42
  type AppPermission = PermissionNode;
40
43
  type MembershipPermission = PermissionNode;
41
44
  interface UsePermissionsOptions {
42
- enabled?: boolean;
45
+ enabled?: boolean;
43
46
  }
44
- declare function usePermissions(options?: UsePermissionsOptions): _tanstack_react_query.UseQueryResult<NoInfer<{
45
- appPermissions: AppPermission[];
46
- membershipPermissions: MembershipPermission[];
47
+ declare function usePermissions(options?: UsePermissionsOptions): import("@tanstack/react-query").UseQueryResult<NoInfer<{
48
+ appPermissions: AppPermission[];
49
+ membershipPermissions: MembershipPermission[];
47
50
  }>, Error>;
48
-
51
+ //#endregion
52
+ //#region src/schema/schema-builder-policies/lib/gql/hooks/schema-builder/use-table-grants.d.ts
49
53
  interface CreateTableGrantInput {
50
- databaseId: string;
51
- tableName: string;
52
- privileges: string[];
53
- fieldNames?: string[];
54
- roleName?: string;
54
+ databaseId: string;
55
+ tableName: string;
56
+ privileges: string[];
57
+ fieldNames?: string[];
58
+ roleName?: string;
55
59
  }
56
60
  /**
57
61
  * Hook for creating table grants (permissions).
@@ -74,7 +78,7 @@ interface CreateTableGrantInput {
74
78
  * fieldNames: ['name', 'description', 'price']
75
79
  * })
76
80
  */
77
- declare function useCreateTableGrant(): _tanstack_react_query.UseMutationResult<GeneratedMutationResult[], Error, CreateTableGrantInput, unknown>;
81
+ declare function useCreateTableGrant(): import("@tanstack/react-query").UseMutationResult<GeneratedMutationResult[], Error, CreateTableGrantInput, unknown>;
78
82
  /**
79
83
  * Hook for creating multiple table grants in batch.
80
84
  * Useful when setting up a new table with standard permissions.
@@ -90,14 +94,15 @@ declare function useCreateTableGrant(): _tanstack_react_query.UseMutationResult<
90
94
  * ]
91
95
  * })
92
96
  */
93
- declare function useBatchCreateTableGrants(): _tanstack_react_query.UseMutationResult<GeneratedMutationResult[][], Error, {
94
- databaseId: string;
95
- tableName: string;
96
- grants: Array<{
97
- privileges: string[];
98
- fieldNames?: string[];
99
- roleName?: string;
100
- }>;
97
+ declare function useBatchCreateTableGrants(): import("@tanstack/react-query").UseMutationResult<GeneratedMutationResult[][], Error, {
98
+ databaseId: string;
99
+ tableName: string;
100
+ grants: Array<{
101
+ privileges: string[];
102
+ fieldNames?: string[];
103
+ roleName?: string;
104
+ }>;
101
105
  }, unknown>;
102
-
103
- export { type CreateTableGrantInput, PoliciesView, TablePolicyConfigCard, useBatchCreateTableGrants, useCreateTableGrant, usePermissions };
106
+ //#endregion
107
+ export { type CreateTableGrantInput, PoliciesView, type SchemaBuilderPoliciesCapabilities, TablePolicyConfigCard, useBatchCreateTableGrants, useCreateTableGrant, usePermissions };
108
+ //# sourceMappingURL=policies.d.cts.map
@@ -1,57 +1,61 @@
1
- import * as react from 'react';
2
- import { CardComponent } from '@constructive-io/ui/stack';
3
- import { C as CrudOperation } from './policy-types-CEYAR5TN.js';
4
- import * as _tanstack_react_query from '@tanstack/react-query';
5
- import { a as GeneratedMutationResult } from './generated-types-CnAlqHU_.js';
6
- export { p as SchemaBuilderPoliciesCapabilities } from './types-Du86atZ8.js';
7
- import 'lucide-react';
8
-
9
- declare function PoliciesView(): react.JSX.Element;
10
-
1
+ import { _ as SchemaBuilderPoliciesCapabilities } from "./types-CXNRA22N.js";
2
+ import "./index-euaSKMQK.js";
3
+ import { t as GeneratedMutationResult } from "./generated-types-DZMUyNBH.js";
4
+ import "./index-BcdFaKFS.js";
5
+ import { t as CrudOperation } from "./policy-types-D_sYWb-b.js";
6
+ import { CardComponent } from "@constructive-io/ui/stack";
7
+ import { ReactNode } from "react";
8
+ import { UseMutationResult } from "@tanstack/react-query";
9
+ //#region src/schema/schema-builder-policies/components/table-editor/policies/policies-view.d.ts
10
+ declare function PoliciesView(): import("react").JSX.Element;
11
+ //#endregion
12
+ //#region src/schema/schema-builder-policies/components/policies/policy-config-card.d.ts
11
13
  interface TablePolicyConfigCardProps {
12
- /** If provided, skip table creation and create policies for this existing table */
13
- tableId?: string;
14
- tableName: string;
15
- selectedPolicyType: string;
16
- /** Pre-select only this operation in the config step */
17
- preSelectedOperation?: CrudOperation;
18
- onTableCreated?: (table: {
19
- id: string;
20
- name: string;
21
- }) => void;
22
- /** Called when policies are created for an existing table (when tableId is provided) */
23
- onPoliciesCreated?: () => void;
24
- onComplete?: () => void;
14
+ /** If provided, skip table creation and create policies for this existing table */
15
+ tableId?: string;
16
+ tableName: string;
17
+ selectedPolicyType: string;
18
+ /** Pre-select only this operation in the config step */
19
+ preSelectedOperation?: CrudOperation;
20
+ onTableCreated?: (table: {
21
+ id: string;
22
+ name: string;
23
+ }) => void;
24
+ /** Called when policies are created for an existing table (when tableId is provided) */
25
+ onPoliciesCreated?: () => void;
26
+ onComplete?: () => void;
25
27
  }
26
28
  /**
27
29
  * Config card for table policy settings.
28
30
  * Shows access rule config and creates all 4 CRUD operation policies by default.
29
31
  */
30
32
  declare const TablePolicyConfigCard: CardComponent<TablePolicyConfigCardProps>;
31
-
33
+ //#endregion
34
+ //#region src/schema/schema-builder-policies/lib/gql/hooks/schema-builder/policies/use-permissions.d.ts
32
35
  interface PermissionNode {
33
- bitnum: number | null;
34
- bitstr: string | null;
35
- description: string | null;
36
- id: string;
37
- name: string;
36
+ bitnum: number | null;
37
+ bitstr: string | null;
38
+ description: string | null;
39
+ id: string;
40
+ name: string;
38
41
  }
39
42
  type AppPermission = PermissionNode;
40
43
  type MembershipPermission = PermissionNode;
41
44
  interface UsePermissionsOptions {
42
- enabled?: boolean;
45
+ enabled?: boolean;
43
46
  }
44
- declare function usePermissions(options?: UsePermissionsOptions): _tanstack_react_query.UseQueryResult<NoInfer<{
45
- appPermissions: AppPermission[];
46
- membershipPermissions: MembershipPermission[];
47
+ declare function usePermissions(options?: UsePermissionsOptions): import("@tanstack/react-query").UseQueryResult<NoInfer<{
48
+ appPermissions: AppPermission[];
49
+ membershipPermissions: MembershipPermission[];
47
50
  }>, Error>;
48
-
51
+ //#endregion
52
+ //#region src/schema/schema-builder-policies/lib/gql/hooks/schema-builder/use-table-grants.d.ts
49
53
  interface CreateTableGrantInput {
50
- databaseId: string;
51
- tableName: string;
52
- privileges: string[];
53
- fieldNames?: string[];
54
- roleName?: string;
54
+ databaseId: string;
55
+ tableName: string;
56
+ privileges: string[];
57
+ fieldNames?: string[];
58
+ roleName?: string;
55
59
  }
56
60
  /**
57
61
  * Hook for creating table grants (permissions).
@@ -74,7 +78,7 @@ interface CreateTableGrantInput {
74
78
  * fieldNames: ['name', 'description', 'price']
75
79
  * })
76
80
  */
77
- declare function useCreateTableGrant(): _tanstack_react_query.UseMutationResult<GeneratedMutationResult[], Error, CreateTableGrantInput, unknown>;
81
+ declare function useCreateTableGrant(): import("@tanstack/react-query").UseMutationResult<GeneratedMutationResult[], Error, CreateTableGrantInput, unknown>;
78
82
  /**
79
83
  * Hook for creating multiple table grants in batch.
80
84
  * Useful when setting up a new table with standard permissions.
@@ -90,14 +94,15 @@ declare function useCreateTableGrant(): _tanstack_react_query.UseMutationResult<
90
94
  * ]
91
95
  * })
92
96
  */
93
- declare function useBatchCreateTableGrants(): _tanstack_react_query.UseMutationResult<GeneratedMutationResult[][], Error, {
94
- databaseId: string;
95
- tableName: string;
96
- grants: Array<{
97
- privileges: string[];
98
- fieldNames?: string[];
99
- roleName?: string;
100
- }>;
97
+ declare function useBatchCreateTableGrants(): import("@tanstack/react-query").UseMutationResult<GeneratedMutationResult[][], Error, {
98
+ databaseId: string;
99
+ tableName: string;
100
+ grants: Array<{
101
+ privileges: string[];
102
+ fieldNames?: string[];
103
+ roleName?: string;
104
+ }>;
101
105
  }, unknown>;
102
-
103
- export { type CreateTableGrantInput, PoliciesView, TablePolicyConfigCard, useBatchCreateTableGrants, useCreateTableGrant, usePermissions };
106
+ //#endregion
107
+ export { type CreateTableGrantInput, PoliciesView, type SchemaBuilderPoliciesCapabilities, TablePolicyConfigCard, useBatchCreateTableGrants, useCreateTableGrant, usePermissions };
108
+ //# sourceMappingURL=policies.d.ts.map