@constructive-io/schema-builder 0.2.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 +26 -0
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/core.cjs +213 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +54 -0
- package/dist/core.d.ts +54 -0
- package/dist/core.js +202 -0
- package/dist/core.js.map +1 -0
- package/dist/fields.cjs +7764 -0
- package/dist/fields.cjs.map +1 -0
- package/dist/fields.d.cts +49 -0
- package/dist/fields.d.ts +49 -0
- package/dist/fields.js +7737 -0
- package/dist/fields.js.map +1 -0
- package/dist/generated-types-CnAlqHU_.d.cts +25 -0
- package/dist/generated-types-CnAlqHU_.d.ts +25 -0
- package/dist/index.cjs +13752 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13720 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes.cjs +1043 -0
- package/dist/indexes.cjs.map +1 -0
- package/dist/indexes.d.cts +36 -0
- package/dist/indexes.d.ts +36 -0
- package/dist/indexes.js +1018 -0
- package/dist/indexes.js.map +1 -0
- package/dist/policies.cjs +5940 -0
- package/dist/policies.cjs.map +1 -0
- package/dist/policies.d.cts +103 -0
- package/dist/policies.d.ts +103 -0
- package/dist/policies.js +5913 -0
- package/dist/policies.js.map +1 -0
- package/dist/policy-types-CEYAR5TN.d.cts +79 -0
- package/dist/policy-types-CEYAR5TN.d.ts +79 -0
- package/dist/relationships.cjs +4329 -0
- package/dist/relationships.cjs.map +1 -0
- package/dist/relationships.d.cts +121 -0
- package/dist/relationships.d.ts +121 -0
- package/dist/relationships.js +4302 -0
- package/dist/relationships.js.map +1 -0
- package/dist/tables.cjs +5645 -0
- package/dist/tables.cjs.map +1 -0
- package/dist/tables.d.cts +29 -0
- package/dist/tables.d.ts +29 -0
- package/dist/tables.js +5620 -0
- package/dist/tables.js.map +1 -0
- package/dist/testing.cjs +69 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +7 -0
- package/dist/testing.d.ts +7 -0
- package/dist/testing.js +67 -0
- package/dist/testing.js.map +1 -0
- package/dist/types-Du86atZ8.d.cts +199 -0
- package/dist/types-Du86atZ8.d.ts +199 -0
- package/dist/types-bX2dCrdl.d.cts +52 -0
- package/dist/types-bX2dCrdl.d.ts +52 -0
- package/package.json +165 -0
- package/src/styles.css +2 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CRUD operation type
|
|
5
|
+
*/
|
|
6
|
+
type CrudOperation = 'create' | 'read' | 'update' | 'delete';
|
|
7
|
+
/**
|
|
8
|
+
* Primitive data type for a field override. Determines the default form component.
|
|
9
|
+
*/
|
|
10
|
+
type FieldType = 'string' | 'boolean' | 'integer' | 'uuid' | 'uuid[]';
|
|
11
|
+
/**
|
|
12
|
+
* Specialized form component override. Takes priority over type-based resolution.
|
|
13
|
+
*/
|
|
14
|
+
type FieldComponent = 'table-select' | 'membership-type-select' | 'permission-select';
|
|
15
|
+
/**
|
|
16
|
+
* Field override for customizing how a policy parameter is displayed in the form.
|
|
17
|
+
* For 'needs-fields' category policies, set pgType to indicate a database column should be created.
|
|
18
|
+
*/
|
|
19
|
+
interface FieldOverride {
|
|
20
|
+
/** Primitive data type — determines which form component to render */
|
|
21
|
+
type?: FieldType;
|
|
22
|
+
/** Specialized form component (takes priority over type) */
|
|
23
|
+
component?: FieldComponent;
|
|
24
|
+
label?: string;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
defaultValue?: unknown;
|
|
28
|
+
/** Whether this field is required */
|
|
29
|
+
required?: boolean;
|
|
30
|
+
/** Hide this field from the form (it will still use defaultValue if provided) */
|
|
31
|
+
hidden?: boolean;
|
|
32
|
+
/** PostgreSQL type - if set, a column will be created for this field */
|
|
33
|
+
pgType?: 'uuid' | 'uuid[]' | 'timestamptz' | 'boolean';
|
|
34
|
+
/** If set, this field depends on another field (e.g. a table-select) for populating dropdown options */
|
|
35
|
+
dependsOn?: string;
|
|
36
|
+
/** Fixed options for select dropdown (e.g. direction: up/down) */
|
|
37
|
+
options?: {
|
|
38
|
+
value: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
}[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Policy category based on POLICY_SYSTEM_REFERENCE.md
|
|
45
|
+
*
|
|
46
|
+
* - 'has-module': Has data node that auto-creates fields (e.g., DataDirectOwner)
|
|
47
|
+
* - 'needs-fields': Needs explicit field creation before policy
|
|
48
|
+
* - 'needs-table': Needs a related table for join-based access
|
|
49
|
+
* - 'no-fields': No fields needed, just creates policy
|
|
50
|
+
*/
|
|
51
|
+
type PolicyCategory = 'has-module' | 'needs-fields' | 'needs-table' | 'no-fields';
|
|
52
|
+
/**
|
|
53
|
+
* Generated field that will be auto-created by a data node
|
|
54
|
+
*/
|
|
55
|
+
interface GeneratedField {
|
|
56
|
+
name: string;
|
|
57
|
+
type: string;
|
|
58
|
+
nullable: boolean;
|
|
59
|
+
description: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Merged policy type combining backend registry data with UI config
|
|
63
|
+
*/
|
|
64
|
+
interface MergedPolicyType {
|
|
65
|
+
name: string;
|
|
66
|
+
title: string;
|
|
67
|
+
description: string;
|
|
68
|
+
icon: LucideIcon;
|
|
69
|
+
category: PolicyCategory;
|
|
70
|
+
hasDataNode: boolean;
|
|
71
|
+
dataNodeType?: string;
|
|
72
|
+
generatedFields: GeneratedField[];
|
|
73
|
+
fieldOverrides?: Record<string, FieldOverride>;
|
|
74
|
+
advancedFields?: string[];
|
|
75
|
+
/** Diagram key — derived from the config object key (always equals `name`) */
|
|
76
|
+
diagramKey: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type { CrudOperation as C, MergedPolicyType as M };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CRUD operation type
|
|
5
|
+
*/
|
|
6
|
+
type CrudOperation = 'create' | 'read' | 'update' | 'delete';
|
|
7
|
+
/**
|
|
8
|
+
* Primitive data type for a field override. Determines the default form component.
|
|
9
|
+
*/
|
|
10
|
+
type FieldType = 'string' | 'boolean' | 'integer' | 'uuid' | 'uuid[]';
|
|
11
|
+
/**
|
|
12
|
+
* Specialized form component override. Takes priority over type-based resolution.
|
|
13
|
+
*/
|
|
14
|
+
type FieldComponent = 'table-select' | 'membership-type-select' | 'permission-select';
|
|
15
|
+
/**
|
|
16
|
+
* Field override for customizing how a policy parameter is displayed in the form.
|
|
17
|
+
* For 'needs-fields' category policies, set pgType to indicate a database column should be created.
|
|
18
|
+
*/
|
|
19
|
+
interface FieldOverride {
|
|
20
|
+
/** Primitive data type — determines which form component to render */
|
|
21
|
+
type?: FieldType;
|
|
22
|
+
/** Specialized form component (takes priority over type) */
|
|
23
|
+
component?: FieldComponent;
|
|
24
|
+
label?: string;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
defaultValue?: unknown;
|
|
28
|
+
/** Whether this field is required */
|
|
29
|
+
required?: boolean;
|
|
30
|
+
/** Hide this field from the form (it will still use defaultValue if provided) */
|
|
31
|
+
hidden?: boolean;
|
|
32
|
+
/** PostgreSQL type - if set, a column will be created for this field */
|
|
33
|
+
pgType?: 'uuid' | 'uuid[]' | 'timestamptz' | 'boolean';
|
|
34
|
+
/** If set, this field depends on another field (e.g. a table-select) for populating dropdown options */
|
|
35
|
+
dependsOn?: string;
|
|
36
|
+
/** Fixed options for select dropdown (e.g. direction: up/down) */
|
|
37
|
+
options?: {
|
|
38
|
+
value: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
}[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Policy category based on POLICY_SYSTEM_REFERENCE.md
|
|
45
|
+
*
|
|
46
|
+
* - 'has-module': Has data node that auto-creates fields (e.g., DataDirectOwner)
|
|
47
|
+
* - 'needs-fields': Needs explicit field creation before policy
|
|
48
|
+
* - 'needs-table': Needs a related table for join-based access
|
|
49
|
+
* - 'no-fields': No fields needed, just creates policy
|
|
50
|
+
*/
|
|
51
|
+
type PolicyCategory = 'has-module' | 'needs-fields' | 'needs-table' | 'no-fields';
|
|
52
|
+
/**
|
|
53
|
+
* Generated field that will be auto-created by a data node
|
|
54
|
+
*/
|
|
55
|
+
interface GeneratedField {
|
|
56
|
+
name: string;
|
|
57
|
+
type: string;
|
|
58
|
+
nullable: boolean;
|
|
59
|
+
description: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Merged policy type combining backend registry data with UI config
|
|
63
|
+
*/
|
|
64
|
+
interface MergedPolicyType {
|
|
65
|
+
name: string;
|
|
66
|
+
title: string;
|
|
67
|
+
description: string;
|
|
68
|
+
icon: LucideIcon;
|
|
69
|
+
category: PolicyCategory;
|
|
70
|
+
hasDataNode: boolean;
|
|
71
|
+
dataNodeType?: string;
|
|
72
|
+
generatedFields: GeneratedField[];
|
|
73
|
+
fieldOverrides?: Record<string, FieldOverride>;
|
|
74
|
+
advancedFields?: string[];
|
|
75
|
+
/** Diagram key — derived from the config object key (always equals `name`) */
|
|
76
|
+
diagramKey: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type { CrudOperation as C, MergedPolicyType as M };
|