@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.
- package/CHANGELOG.md +11 -0
- 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-WwCS0CKu.cjs +66 -0
- package/dist/core-WwCS0CKu.cjs.map +1 -0
- package/dist/core-kx6KjxE5.js +49 -0
- package/dist/core-kx6KjxE5.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-BzNKfpXO.cjs +7726 -0
- package/dist/create-table-card-BzNKfpXO.cjs.map +1 -0
- package/dist/create-table-card-pZ0Aq6rr.js +7685 -0
- package/dist/create-table-card-pZ0Aq6rr.js.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-DMn8ADRq.cjs +62 -0
- package/dist/empty-state-card-DMn8ADRq.cjs.map +1 -0
- package/dist/empty-state-card-Dnn36JVH.js +57 -0
- package/dist/empty-state-card-Dnn36JVH.js.map +1 -0
- package/dist/fields.cjs +8 -7763
- package/dist/fields.d.cts +39 -39
- package/dist/fields.d.ts +39 -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-9h0EROdb.d.cts +56 -0
- package/dist/index-CwQ9QpxA.d.ts +7 -0
- package/dist/index-DOWB1UBK.d.cts +56 -0
- package/dist/index-DOWB1UBK.d.ts +56 -0
- package/dist/index-Dgb_e3AP.d.cts +7 -0
- package/dist/index-p_NegPQ5.d.ts +56 -0
- package/dist/index.cjs +736 -13712
- 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 +725 -13680
- package/dist/index.js.map +1 -1
- package/dist/indexes-view-CJ1WQKdp.js +736 -0
- package/dist/indexes-view-CJ1WQKdp.js.map +1 -0
- package/dist/indexes-view-peIv6QUZ.cjs +759 -0
- package/dist/indexes-view-peIv6QUZ.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-9DsT5NlP.cjs +2862 -0
- package/dist/invalidate-database-entities-9DsT5NlP.cjs.map +1 -0
- package/dist/invalidate-database-entities-CmmOT3S0.js +2559 -0
- package/dist/invalidate-database-entities-CmmOT3S0.js.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-BRbpbyB6.js +1018 -0
- package/dist/policies-view-BRbpbyB6.js.map +1 -0
- package/dist/policies-view-H1HTjpmv.cjs +1023 -0
- package/dist/policies-view-H1HTjpmv.cjs.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-BwyK7DGV.js +2502 -0
- package/dist/policy-config-form-BwyK7DGV.js.map +1 -0
- package/dist/policy-config-form-CefFo6Fw.cjs +2629 -0
- package/dist/policy-config-form-CefFo6Fw.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-BmN_qO0W.js +171 -0
- package/dist/query-BmN_qO0W.js.map +1 -0
- package/dist/query-DU-KZleN.cjs +212 -0
- package/dist/query-DU-KZleN.cjs.map +1 -0
- package/dist/relationships-view-B5TAcPHU.cjs +2452 -0
- package/dist/relationships-view-B5TAcPHU.cjs.map +1 -0
- package/dist/relationships-view-DbwFh5r-.js +2417 -0
- package/dist/relationships-view-DbwFh5r-.js.map +1 -0
- package/dist/relationships.cjs +9 -4328
- package/dist/relationships.d.cts +93 -92
- package/dist/relationships.d.ts +93 -92
- package/dist/relationships.js +2 -4300
- package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
- package/dist/schema-builder-sidebar-Ctu621Vw.cjs +604 -0
- package/dist/schema-builder-sidebar-Ctu621Vw.cjs.map +1 -0
- package/dist/schema-builder-sidebar-VR-Ctidc.js +593 -0
- package/dist/schema-builder-sidebar-VR-Ctidc.js.map +1 -0
- package/dist/table-editor-C-hHz3DJ.cjs +1935 -0
- package/dist/table-editor-C-hHz3DJ.cjs.map +1 -0
- package/dist/table-editor-IVp3B4nG.js +1906 -0
- package/dist/table-editor-IVp3B4nG.js.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-GUrH1Qny.d.cts +200 -0
- package/dist/types-GUrH1Qny.d.ts +200 -0
- package/dist/use-update-table-C7v3gRyG.cjs +291 -0
- package/dist/use-update-table-C7v3gRyG.cjs.map +1 -0
- package/dist/use-update-table-Dz6knGoH.js +244 -0
- package/dist/use-update-table-Dz6knGoH.js.map +1 -0
- package/package.json +6 -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/policies.d.cts
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { _ as SchemaBuilderPoliciesCapabilities } from "./types-GUrH1Qny.cjs";
|
|
2
|
+
import "./index-9h0EROdb.cjs";
|
|
3
|
+
import { t as GeneratedMutationResult } from "./generated-types-DZMUyNBH.cjs";
|
|
4
|
+
import "./index-Dgb_e3AP.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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
45
|
+
enabled?: boolean;
|
|
43
46
|
}
|
|
44
|
-
declare function usePermissions(options?: UsePermissionsOptions):
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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():
|
|
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():
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
package/dist/policies.d.ts
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { _ as SchemaBuilderPoliciesCapabilities } from "./types-GUrH1Qny.js";
|
|
2
|
+
import "./index-p_NegPQ5.js";
|
|
3
|
+
import { t as GeneratedMutationResult } from "./generated-types-DZMUyNBH.js";
|
|
4
|
+
import "./index-CwQ9QpxA.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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
45
|
+
enabled?: boolean;
|
|
43
46
|
}
|
|
44
|
-
declare function usePermissions(options?: UsePermissionsOptions):
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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():
|
|
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():
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|