node-type-registry 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/LICENSE +23 -0
- package/README.md +87 -0
- package/authz/authz-allow-all.d.ts +2 -0
- package/authz/authz-allow-all.js +15 -0
- package/authz/authz-composite.d.ts +2 -0
- package/authz/authz-composite.js +39 -0
- package/authz/authz-deny-all.d.ts +2 -0
- package/authz/authz-deny-all.js +15 -0
- package/authz/authz-direct-owner-any.d.ts +2 -0
- package/authz/authz-direct-owner-any.js +26 -0
- package/authz/authz-direct-owner.d.ts +2 -0
- package/authz/authz-direct-owner.js +23 -0
- package/authz/authz-entity-membership.d.ts +2 -0
- package/authz/authz-entity-membership.js +49 -0
- package/authz/authz-member-list.d.ts +2 -0
- package/authz/authz-member-list.js +23 -0
- package/authz/authz-membership-check.d.ts +2 -0
- package/authz/authz-membership-check.js +45 -0
- package/authz/authz-org-hierarchy.d.ts +2 -0
- package/authz/authz-org-hierarchy.js +41 -0
- package/authz/authz-peer-ownership.d.ts +2 -0
- package/authz/authz-peer-ownership.js +49 -0
- package/authz/authz-publishable.d.ts +2 -0
- package/authz/authz-publishable.js +31 -0
- package/authz/authz-related-entity-membership.d.ts +2 -0
- package/authz/authz-related-entity-membership.js +71 -0
- package/authz/authz-related-member-list.d.ts +2 -0
- package/authz/authz-related-member-list.js +43 -0
- package/authz/authz-related-peer-ownership.d.ts +2 -0
- package/authz/authz-related-peer-ownership.js +75 -0
- package/authz/authz-temporal.d.ts +2 -0
- package/authz/authz-temporal.js +46 -0
- package/authz/index.d.ts +15 -0
- package/authz/index.js +33 -0
- package/codegen/generate-seed.d.ts +23 -0
- package/codegen/generate-seed.js +155 -0
- package/data/data-bm25.d.ts +2 -0
- package/data/data-bm25.js +43 -0
- package/data/data-direct-owner.d.ts +2 -0
- package/data/data-direct-owner.js +31 -0
- package/data/data-embedding.d.ts +2 -0
- package/data/data-embedding.js +82 -0
- package/data/data-entity-membership.d.ts +2 -0
- package/data/data-entity-membership.js +31 -0
- package/data/data-full-text-search.d.ts +2 -0
- package/data/data-full-text-search.js +61 -0
- package/data/data-id.d.ts +2 -0
- package/data/data-id.js +21 -0
- package/data/data-job-trigger.d.ts +2 -0
- package/data/data-job-trigger.js +111 -0
- package/data/data-jsonb.d.ts +2 -0
- package/data/data-jsonb.js +35 -0
- package/data/data-ownership-in-entity.d.ts +2 -0
- package/data/data-ownership-in-entity.js +26 -0
- package/data/data-peoplestamps.d.ts +2 -0
- package/data/data-peoplestamps.js +26 -0
- package/data/data-postgis-aggregate.d.ts +2 -0
- package/data/data-postgis-aggregate.js +94 -0
- package/data/data-postgis.d.ts +2 -0
- package/data/data-postgis.js +65 -0
- package/data/data-publishable.d.ts +2 -0
- package/data/data-publishable.js +21 -0
- package/data/data-search.d.ts +2 -0
- package/data/data-search.js +158 -0
- package/data/data-soft-delete.d.ts +2 -0
- package/data/data-soft-delete.js +21 -0
- package/data/data-status-field.d.ts +2 -0
- package/data/data-status-field.js +42 -0
- package/data/data-tags.d.ts +2 -0
- package/data/data-tags.js +30 -0
- package/data/data-timestamps.d.ts +2 -0
- package/data/data-timestamps.js +21 -0
- package/data/data-trgm.d.ts +2 -0
- package/data/data-trgm.js +26 -0
- package/data/index.d.ts +19 -0
- package/data/index.js +41 -0
- package/esm/authz/authz-allow-all.d.ts +2 -0
- package/esm/authz/authz-allow-all.js +12 -0
- package/esm/authz/authz-composite.d.ts +2 -0
- package/esm/authz/authz-composite.js +36 -0
- package/esm/authz/authz-deny-all.d.ts +2 -0
- package/esm/authz/authz-deny-all.js +12 -0
- package/esm/authz/authz-direct-owner-any.d.ts +2 -0
- package/esm/authz/authz-direct-owner-any.js +23 -0
- package/esm/authz/authz-direct-owner.d.ts +2 -0
- package/esm/authz/authz-direct-owner.js +20 -0
- package/esm/authz/authz-entity-membership.d.ts +2 -0
- package/esm/authz/authz-entity-membership.js +46 -0
- package/esm/authz/authz-member-list.d.ts +2 -0
- package/esm/authz/authz-member-list.js +20 -0
- package/esm/authz/authz-membership-check.d.ts +2 -0
- package/esm/authz/authz-membership-check.js +42 -0
- package/esm/authz/authz-org-hierarchy.d.ts +2 -0
- package/esm/authz/authz-org-hierarchy.js +38 -0
- package/esm/authz/authz-peer-ownership.d.ts +2 -0
- package/esm/authz/authz-peer-ownership.js +46 -0
- package/esm/authz/authz-publishable.d.ts +2 -0
- package/esm/authz/authz-publishable.js +28 -0
- package/esm/authz/authz-related-entity-membership.d.ts +2 -0
- package/esm/authz/authz-related-entity-membership.js +68 -0
- package/esm/authz/authz-related-member-list.d.ts +2 -0
- package/esm/authz/authz-related-member-list.js +40 -0
- package/esm/authz/authz-related-peer-ownership.d.ts +2 -0
- package/esm/authz/authz-related-peer-ownership.js +72 -0
- package/esm/authz/authz-temporal.d.ts +2 -0
- package/esm/authz/authz-temporal.js +43 -0
- package/esm/authz/index.d.ts +15 -0
- package/esm/authz/index.js +15 -0
- package/esm/codegen/generate-seed.d.ts +23 -0
- package/esm/codegen/generate-seed.js +153 -0
- package/esm/data/data-bm25.d.ts +2 -0
- package/esm/data/data-bm25.js +40 -0
- package/esm/data/data-direct-owner.d.ts +2 -0
- package/esm/data/data-direct-owner.js +28 -0
- package/esm/data/data-embedding.d.ts +2 -0
- package/esm/data/data-embedding.js +79 -0
- package/esm/data/data-entity-membership.d.ts +2 -0
- package/esm/data/data-entity-membership.js +28 -0
- package/esm/data/data-full-text-search.d.ts +2 -0
- package/esm/data/data-full-text-search.js +58 -0
- package/esm/data/data-id.d.ts +2 -0
- package/esm/data/data-id.js +18 -0
- package/esm/data/data-job-trigger.d.ts +2 -0
- package/esm/data/data-job-trigger.js +108 -0
- package/esm/data/data-jsonb.d.ts +2 -0
- package/esm/data/data-jsonb.js +32 -0
- package/esm/data/data-ownership-in-entity.d.ts +2 -0
- package/esm/data/data-ownership-in-entity.js +23 -0
- package/esm/data/data-peoplestamps.d.ts +2 -0
- package/esm/data/data-peoplestamps.js +23 -0
- package/esm/data/data-postgis-aggregate.d.ts +2 -0
- package/esm/data/data-postgis-aggregate.js +91 -0
- package/esm/data/data-postgis.d.ts +2 -0
- package/esm/data/data-postgis.js +62 -0
- package/esm/data/data-publishable.d.ts +2 -0
- package/esm/data/data-publishable.js +18 -0
- package/esm/data/data-search.d.ts +2 -0
- package/esm/data/data-search.js +155 -0
- package/esm/data/data-soft-delete.d.ts +2 -0
- package/esm/data/data-soft-delete.js +18 -0
- package/esm/data/data-status-field.d.ts +2 -0
- package/esm/data/data-status-field.js +39 -0
- package/esm/data/data-tags.d.ts +2 -0
- package/esm/data/data-tags.js +27 -0
- package/esm/data/data-timestamps.d.ts +2 -0
- package/esm/data/data-timestamps.js +18 -0
- package/esm/data/data-trgm.d.ts +2 -0
- package/esm/data/data-trgm.js +23 -0
- package/esm/data/index.d.ts +19 -0
- package/esm/data/index.js +19 -0
- package/esm/field/field-immutable.d.ts +2 -0
- package/esm/field/field-immutable.js +21 -0
- package/esm/field/field-inflection.d.ts +2 -0
- package/esm/field/field-inflection.js +29 -0
- package/esm/field/field-owned.d.ts +2 -0
- package/esm/field/field-owned.js +36 -0
- package/esm/field/field-slug.d.ts +2 -0
- package/esm/field/field-slug.js +26 -0
- package/esm/field/index.d.ts +4 -0
- package/esm/field/index.js +4 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.js +21 -0
- package/esm/preset.d.ts +23 -0
- package/esm/preset.js +5 -0
- package/esm/relation/index.d.ts +4 -0
- package/esm/relation/index.js +4 -0
- package/esm/relation/relation-belongs-to.d.ts +2 -0
- package/esm/relation/relation-belongs-to.js +48 -0
- package/esm/relation/relation-has-many.d.ts +2 -0
- package/esm/relation/relation-has-many.js +48 -0
- package/esm/relation/relation-has-one.d.ts +2 -0
- package/esm/relation/relation-has-one.js +48 -0
- package/esm/relation/relation-many-to-many.d.ts +2 -0
- package/esm/relation/relation-many-to-many.js +92 -0
- package/esm/table/index.d.ts +3 -0
- package/esm/table/index.js +3 -0
- package/esm/table/table-organization-settings.d.ts +2 -0
- package/esm/table/table-organization-settings.js +12 -0
- package/esm/table/table-user-profiles.d.ts +2 -0
- package/esm/table/table-user-profiles.js +12 -0
- package/esm/table/table-user-settings.d.ts +2 -0
- package/esm/table/table-user-settings.js +12 -0
- package/esm/types.d.ts +61 -0
- package/esm/types.js +1 -0
- package/esm/view/index.d.ts +5 -0
- package/esm/view/index.js +5 -0
- package/esm/view/view-aggregated.d.ts +2 -0
- package/esm/view/view-aggregated.js +61 -0
- package/esm/view/view-composite.d.ts +2 -0
- package/esm/view/view-composite.js +20 -0
- package/esm/view/view-filtered-table.d.ts +2 -0
- package/esm/view/view-filtered-table.js +45 -0
- package/esm/view/view-joined-tables.d.ts +2 -0
- package/esm/view/view-joined-tables.js +80 -0
- package/esm/view/view-table-projection.d.ts +2 -0
- package/esm/view/view-table-projection.js +36 -0
- package/field/field-immutable.d.ts +2 -0
- package/field/field-immutable.js +24 -0
- package/field/field-inflection.d.ts +2 -0
- package/field/field-inflection.js +32 -0
- package/field/field-owned.d.ts +2 -0
- package/field/field-owned.js +39 -0
- package/field/field-slug.d.ts +2 -0
- package/field/field-slug.js +29 -0
- package/field/index.d.ts +4 -0
- package/field/index.js +11 -0
- package/index.d.ts +9 -0
- package/index.js +60 -0
- package/package.json +49 -0
- package/preset.d.ts +23 -0
- package/preset.js +8 -0
- package/relation/index.d.ts +4 -0
- package/relation/index.js +11 -0
- package/relation/relation-belongs-to.d.ts +2 -0
- package/relation/relation-belongs-to.js +51 -0
- package/relation/relation-has-many.d.ts +2 -0
- package/relation/relation-has-many.js +51 -0
- package/relation/relation-has-one.d.ts +2 -0
- package/relation/relation-has-one.js +51 -0
- package/relation/relation-many-to-many.d.ts +2 -0
- package/relation/relation-many-to-many.js +95 -0
- package/table/index.d.ts +3 -0
- package/table/index.js +9 -0
- package/table/table-organization-settings.d.ts +2 -0
- package/table/table-organization-settings.js +15 -0
- package/table/table-user-profiles.d.ts +2 -0
- package/table/table-user-profiles.js +15 -0
- package/table/table-user-settings.d.ts +2 -0
- package/table/table-user-settings.js +15 -0
- package/types.d.ts +61 -0
- package/types.js +2 -0
- package/view/index.d.ts +5 -0
- package/view/index.js +13 -0
- package/view/view-aggregated.d.ts +2 -0
- package/view/view-aggregated.js +64 -0
- package/view/view-composite.d.ts +2 -0
- package/view/view-composite.js +23 -0
- package/view/view-filtered-table.d.ts +2 -0
- package/view/view-filtered-table.js +48 -0
- package/view/view-joined-tables.d.ts +2 -0
- package/view/view-joined-tables.js +83 -0
- package/view/view-table-projection.d.ts +2 -0
- package/view/view-table-projection.js +39 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const DataTimestamps = {
|
|
2
|
+
name: 'DataTimestamps',
|
|
3
|
+
slug: 'data_timestamps',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'Timestamps',
|
|
6
|
+
description: 'Adds automatic timestamp tracking with created_at and updated_at columns.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"include_id": {
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"description": "If true, also adds a UUID primary key column with auto-generation",
|
|
13
|
+
"default": true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
tags: ['timestamps', 'schema'],
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const DataTrgm = {
|
|
2
|
+
name: 'DataTrgm',
|
|
3
|
+
slug: 'data_trgm',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'Trigram Search',
|
|
6
|
+
description: 'Creates GIN trigram indexes (gin_trgm_ops) on specified text/citext fields for fuzzy LIKE/ILIKE/similarity search. Adds @trgmSearch smart tag for PostGraphile integration. Fields must already exist on the table.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"fields": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"description": "Field names to create trigram indexes on (fields must already exist on the table)"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"fields"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
tags: ['search', 'trigram', 'schema'],
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { DataId } from './data-id';
|
|
2
|
+
export { DataDirectOwner } from './data-direct-owner';
|
|
3
|
+
export { DataEntityMembership } from './data-entity-membership';
|
|
4
|
+
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
5
|
+
export { DataTimestamps } from './data-timestamps';
|
|
6
|
+
export { DataPeoplestamps } from './data-peoplestamps';
|
|
7
|
+
export { DataPublishable } from './data-publishable';
|
|
8
|
+
export { DataSoftDelete } from './data-soft-delete';
|
|
9
|
+
export { DataEmbedding } from './data-embedding';
|
|
10
|
+
export { DataFullTextSearch } from './data-full-text-search';
|
|
11
|
+
export { DataBm25 } from './data-bm25';
|
|
12
|
+
export { DataSearch } from './data-search';
|
|
13
|
+
export { DataPostGIS } from './data-postgis';
|
|
14
|
+
export { DataPostGISAggregate } from './data-postgis-aggregate';
|
|
15
|
+
export { DataJobTrigger } from './data-job-trigger';
|
|
16
|
+
export { DataTags } from './data-tags';
|
|
17
|
+
export { DataStatusField } from './data-status-field';
|
|
18
|
+
export { DataJsonb } from './data-jsonb';
|
|
19
|
+
export { DataTrgm } from './data-trgm';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { DataId } from './data-id';
|
|
2
|
+
export { DataDirectOwner } from './data-direct-owner';
|
|
3
|
+
export { DataEntityMembership } from './data-entity-membership';
|
|
4
|
+
export { DataOwnershipInEntity } from './data-ownership-in-entity';
|
|
5
|
+
export { DataTimestamps } from './data-timestamps';
|
|
6
|
+
export { DataPeoplestamps } from './data-peoplestamps';
|
|
7
|
+
export { DataPublishable } from './data-publishable';
|
|
8
|
+
export { DataSoftDelete } from './data-soft-delete';
|
|
9
|
+
export { DataEmbedding } from './data-embedding';
|
|
10
|
+
export { DataFullTextSearch } from './data-full-text-search';
|
|
11
|
+
export { DataBm25 } from './data-bm25';
|
|
12
|
+
export { DataSearch } from './data-search';
|
|
13
|
+
export { DataPostGIS } from './data-postgis';
|
|
14
|
+
export { DataPostGISAggregate } from './data-postgis-aggregate';
|
|
15
|
+
export { DataJobTrigger } from './data-job-trigger';
|
|
16
|
+
export { DataTags } from './data-tags';
|
|
17
|
+
export { DataStatusField } from './data-status-field';
|
|
18
|
+
export { DataJsonb } from './data-jsonb';
|
|
19
|
+
export { DataTrgm } from './data-trgm';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const FieldImmutable = {
|
|
2
|
+
name: 'FieldImmutable',
|
|
3
|
+
slug: 'field_immutable',
|
|
4
|
+
category: 'field',
|
|
5
|
+
display_name: 'Immutable',
|
|
6
|
+
description: 'Prevents a field from being modified after initial insert.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"field_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "UUID of the field that cannot be updated"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": [
|
|
17
|
+
"field_id"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
tags: ['constraint', 'behavior'],
|
|
21
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const FieldInflection = {
|
|
2
|
+
name: 'FieldInflection',
|
|
3
|
+
slug: 'field_inflection',
|
|
4
|
+
category: 'field',
|
|
5
|
+
display_name: 'Inflection',
|
|
6
|
+
description: 'Transforms field values using inflection operations (snake_case, camelCase, etc).',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"field_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "Target field"
|
|
14
|
+
},
|
|
15
|
+
"ops": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"description": "Inflection operations to apply"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"required": [
|
|
24
|
+
"field_id",
|
|
25
|
+
"ops"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
tags: ['transform', 'behavior'],
|
|
29
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const FieldOwned = {
|
|
2
|
+
name: 'FieldOwned',
|
|
3
|
+
slug: 'field_owned',
|
|
4
|
+
category: 'field',
|
|
5
|
+
display_name: 'Owned',
|
|
6
|
+
description: 'Restricts which user can modify specific columns in shared objects. For tables where multiple users have access but each can only modify certain columns.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"table_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "Target table"
|
|
14
|
+
},
|
|
15
|
+
"role_key_field_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uuid",
|
|
18
|
+
"description": "Field identifying the owner (e.g., sender_id)"
|
|
19
|
+
},
|
|
20
|
+
"protected_field_ids": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "uuid"
|
|
25
|
+
},
|
|
26
|
+
"description": "Fields only this owner can modify"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": [
|
|
30
|
+
"table_id",
|
|
31
|
+
"role_key_field_id",
|
|
32
|
+
"protected_field_ids"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
tags: ['ownership', 'constraint', 'behavior'],
|
|
36
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const FieldSlug = {
|
|
2
|
+
name: 'FieldSlug',
|
|
3
|
+
slug: 'field_slug',
|
|
4
|
+
category: 'field',
|
|
5
|
+
display_name: 'Slug',
|
|
6
|
+
description: 'Auto-generates URL-friendly slugs from field values on insert/update.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"field_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "Target field to slugify"
|
|
14
|
+
},
|
|
15
|
+
"source_field_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uuid",
|
|
18
|
+
"description": "Optional source field (defaults to target)"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"field_id"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
tags: ['transform', 'behavior'],
|
|
26
|
+
};
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { NodeTypeDefinition, JSONSchema } from './types';
|
|
2
|
+
export * from './authz';
|
|
3
|
+
export * from './data';
|
|
4
|
+
export * from './field';
|
|
5
|
+
export * from './relation';
|
|
6
|
+
export * from './view';
|
|
7
|
+
export * from './table';
|
|
8
|
+
import type { NodeTypeDefinition } from './types';
|
|
9
|
+
export declare const allNodeTypes: NodeTypeDefinition[];
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Re-export all node definitions by category
|
|
2
|
+
export * from './authz';
|
|
3
|
+
export * from './data';
|
|
4
|
+
export * from './field';
|
|
5
|
+
export * from './relation';
|
|
6
|
+
export * from './view';
|
|
7
|
+
export * from './table';
|
|
8
|
+
import * as authz from './authz';
|
|
9
|
+
import * as data from './data';
|
|
10
|
+
import * as field from './field';
|
|
11
|
+
import * as relation from './relation';
|
|
12
|
+
import * as view from './view';
|
|
13
|
+
import * as table from './table';
|
|
14
|
+
export const allNodeTypes = [
|
|
15
|
+
...Object.values(authz),
|
|
16
|
+
...Object.values(data),
|
|
17
|
+
...Object.values(field),
|
|
18
|
+
...Object.values(relation),
|
|
19
|
+
...Object.values(view),
|
|
20
|
+
...Object.values(table),
|
|
21
|
+
];
|
package/esm/preset.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostGraphile v5 Preset for Node Type Registry
|
|
3
|
+
*
|
|
4
|
+
* Opt-in preset that generates @oneOf typed GraphQL input types
|
|
5
|
+
* (BlueprintDefinitionInput, BlueprintNodeInput, etc.) from the
|
|
6
|
+
* TS node type definitions. Uses the existing createBlueprintTypesPlugin
|
|
7
|
+
* factory — no DB query needed.
|
|
8
|
+
*
|
|
9
|
+
* This preset is NOT included in ConstructivePreset (which is for all
|
|
10
|
+
* Constructive databases). It should only be layered on by the
|
|
11
|
+
* constructive-db SDK codegen or other consumers that need blueprint types.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* import { NodeTypeRegistryPreset } from 'node-type-registry/preset';
|
|
15
|
+
*
|
|
16
|
+
* const sdl = await buildSchemaSDL({
|
|
17
|
+
* database: dbConfig.database,
|
|
18
|
+
* schemas,
|
|
19
|
+
* graphile: { extends: [NodeTypeRegistryPreset] },
|
|
20
|
+
* });
|
|
21
|
+
*/
|
|
22
|
+
import type { GraphileConfig } from 'graphile-config';
|
|
23
|
+
export declare const NodeTypeRegistryPreset: GraphileConfig.Preset;
|
package/esm/preset.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const RelationBelongsTo = {
|
|
2
|
+
name: 'RelationBelongsTo',
|
|
3
|
+
slug: 'relation_belongs_to',
|
|
4
|
+
category: 'relation',
|
|
5
|
+
display_name: 'Belongs To',
|
|
6
|
+
description: 'Creates a foreign key field on the source table referencing the target table. Auto-derives the FK field name from the target table name using inflection (e.g., projects derives project_id). delete_action is required and must be explicitly provided by the caller.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"source_table_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "Table that will have the FK field added"
|
|
14
|
+
},
|
|
15
|
+
"target_table_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uuid",
|
|
18
|
+
"description": "Table being referenced by the FK"
|
|
19
|
+
},
|
|
20
|
+
"field_name": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "FK field name on the source table. Auto-derived from target table name if omitted (e.g., projects → project_id)"
|
|
23
|
+
},
|
|
24
|
+
"delete_action": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": [
|
|
27
|
+
"c",
|
|
28
|
+
"r",
|
|
29
|
+
"n",
|
|
30
|
+
"d",
|
|
31
|
+
"a"
|
|
32
|
+
],
|
|
33
|
+
"description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
|
|
34
|
+
},
|
|
35
|
+
"is_required": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "Whether the FK field is NOT NULL",
|
|
38
|
+
"default": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": [
|
|
42
|
+
"source_table_id",
|
|
43
|
+
"target_table_id",
|
|
44
|
+
"delete_action"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
tags: ['relation', 'foreign_key', 'schema'],
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const RelationHasMany = {
|
|
2
|
+
name: 'RelationHasMany',
|
|
3
|
+
slug: 'relation_has_many',
|
|
4
|
+
category: 'relation',
|
|
5
|
+
display_name: 'Has Many',
|
|
6
|
+
description: 'Creates a foreign key field on the target table referencing the source table. Inverse of RelationBelongsTo — same FK, different perspective. "projects has many tasks" creates tasks.project_id. Auto-derives the FK field name from the source table name using inflection. delete_action is required and must be explicitly provided by the caller.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"source_table_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "Parent table being referenced by the FK (e.g., projects in projects has many tasks)"
|
|
14
|
+
},
|
|
15
|
+
"target_table_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uuid",
|
|
18
|
+
"description": "Child table that receives the FK field (e.g., tasks in projects has many tasks)"
|
|
19
|
+
},
|
|
20
|
+
"field_name": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "FK field name on the target table. Auto-derived from source table name if omitted (e.g., projects derives project_id)"
|
|
23
|
+
},
|
|
24
|
+
"delete_action": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": [
|
|
27
|
+
"c",
|
|
28
|
+
"r",
|
|
29
|
+
"n",
|
|
30
|
+
"d",
|
|
31
|
+
"a"
|
|
32
|
+
],
|
|
33
|
+
"description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
|
|
34
|
+
},
|
|
35
|
+
"is_required": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "Whether the FK field is NOT NULL",
|
|
38
|
+
"default": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": [
|
|
42
|
+
"source_table_id",
|
|
43
|
+
"target_table_id",
|
|
44
|
+
"delete_action"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
tags: ['relation', 'foreign_key', 'has_many', 'schema'],
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const RelationHasOne = {
|
|
2
|
+
name: 'RelationHasOne',
|
|
3
|
+
slug: 'relation_has_one',
|
|
4
|
+
category: 'relation',
|
|
5
|
+
display_name: 'Has One',
|
|
6
|
+
description: 'Creates a foreign key field with a unique constraint on the source table referencing the target table. Enforces 1:1 cardinality. Auto-derives the FK field name from the target table name using inflection. delete_action is required and must be explicitly provided by the caller.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"source_table_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "Table that will have the FK field and unique constraint"
|
|
14
|
+
},
|
|
15
|
+
"target_table_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uuid",
|
|
18
|
+
"description": "Table being referenced by the FK"
|
|
19
|
+
},
|
|
20
|
+
"field_name": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "FK field name on the source table. Auto-derived from target table name if omitted (e.g., users → user_id)"
|
|
23
|
+
},
|
|
24
|
+
"delete_action": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": [
|
|
27
|
+
"c",
|
|
28
|
+
"r",
|
|
29
|
+
"n",
|
|
30
|
+
"d",
|
|
31
|
+
"a"
|
|
32
|
+
],
|
|
33
|
+
"description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
|
|
34
|
+
},
|
|
35
|
+
"is_required": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "Whether the FK field is NOT NULL",
|
|
38
|
+
"default": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": [
|
|
42
|
+
"source_table_id",
|
|
43
|
+
"target_table_id",
|
|
44
|
+
"delete_action"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
tags: ['relation', 'foreign_key', 'unique', 'schema'],
|
|
48
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export const RelationManyToMany = {
|
|
2
|
+
name: 'RelationManyToMany',
|
|
3
|
+
slug: 'relation_many_to_many',
|
|
4
|
+
category: 'relation',
|
|
5
|
+
display_name: 'Many to Many',
|
|
6
|
+
description: 'Creates a junction table between source and target tables with auto-derived naming and FK fields. The trigger creates a bare table (no implicit DataId or any node_type), adds FK fields to both tables, optionally creates a composite PK (use_composite_key), then forwards all security config to secure_table_provision as-is. The trigger never injects values the caller did not provide. Junction table FKs always CASCADE on delete.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"source_table_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uuid",
|
|
13
|
+
"description": "First table in the M:N relationship"
|
|
14
|
+
},
|
|
15
|
+
"target_table_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uuid",
|
|
18
|
+
"description": "Second table in the M:N relationship"
|
|
19
|
+
},
|
|
20
|
+
"junction_table_id": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"format": "uuid",
|
|
23
|
+
"description": "Existing junction table to use. If uuid_nil(), a new bare table is created"
|
|
24
|
+
},
|
|
25
|
+
"junction_table_name": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Junction table name. Auto-derived from both table names if omitted (e.g., projects + tags derives project_tags)"
|
|
28
|
+
},
|
|
29
|
+
"source_field_name": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "FK field name on junction for source table. Auto-derived if omitted (e.g., projects derives project_id)"
|
|
32
|
+
},
|
|
33
|
+
"target_field_name": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "FK field name on junction for target table. Auto-derived if omitted (e.g., tags derives tag_id)"
|
|
36
|
+
},
|
|
37
|
+
"use_composite_key": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "When true, creates a composite PK from the two FK fields. When false, no PK is created by the trigger (use node_type=DataId for UUID PK). Mutually exclusive with node_type=DataId.",
|
|
40
|
+
"default": false
|
|
41
|
+
},
|
|
42
|
+
"node_type": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "Generator for field creation on junction table. Forwarded to secure_table_provision as-is. Examples: DataId, DataEntityMembership, DataDirectOwner. NULL means no additional fields."
|
|
45
|
+
},
|
|
46
|
+
"node_data": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"description": "Configuration for the generator. Forwarded to secure_table_provision as-is. Only used when node_type is set."
|
|
49
|
+
},
|
|
50
|
+
"grant_roles": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"description": "Database roles to grant privileges to. Forwarded to secure_table_provision as-is. Default: [authenticated]"
|
|
56
|
+
},
|
|
57
|
+
"grant_privileges": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"description": "Privilege grants for the junction table. Forwarded to secure_table_provision as-is. Default: select/insert/delete for all columns"
|
|
60
|
+
},
|
|
61
|
+
"policy_type": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "RLS policy type for the junction table. Forwarded to secure_table_provision as-is. NULL means no policy."
|
|
64
|
+
},
|
|
65
|
+
"policy_privileges": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"description": "Privileges the policy applies to. Forwarded to secure_table_provision as-is. NULL means derived from grant_privileges verbs."
|
|
71
|
+
},
|
|
72
|
+
"policy_role": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "Database role the policy targets. Forwarded to secure_table_provision as-is. NULL means falls back to first grant_role."
|
|
75
|
+
},
|
|
76
|
+
"policy_permissive": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"description": "Whether the policy is PERMISSIVE (true) or RESTRICTIVE (false). Forwarded to secure_table_provision as-is.",
|
|
79
|
+
"default": true
|
|
80
|
+
},
|
|
81
|
+
"policy_data": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"description": "Policy configuration forwarded to secure_table_provision as-is. Structure varies by policy_type."
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": [
|
|
87
|
+
"source_table_id",
|
|
88
|
+
"target_table_id"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
tags: ['relation', 'junction', 'many_to_many', 'schema'],
|
|
92
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const TableOrganizationSettings = {
|
|
2
|
+
name: 'TableOrganizationSettings',
|
|
3
|
+
slug: 'table_organization_settings',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'Organization Settings',
|
|
6
|
+
description: 'Creates an organization settings table with standard business fields (legal_name, address fields). Uses AuthzEntityMembership for access control.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {}
|
|
10
|
+
},
|
|
11
|
+
tags: ['template', 'settings', 'membership', 'schema'],
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const TableUserProfiles = {
|
|
2
|
+
name: 'TableUserProfiles',
|
|
3
|
+
slug: 'table_user_profiles',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'User Profiles',
|
|
6
|
+
description: 'Creates a user profiles table with standard profile fields (profile_picture, bio, first_name, last_name, tags, desired). Uses AuthzDirectOwner for edit access and AuthzAllowAll for select.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {}
|
|
10
|
+
},
|
|
11
|
+
tags: ['template', 'settings', 'ownership', 'schema'],
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const TableUserSettings = {
|
|
2
|
+
name: 'TableUserSettings',
|
|
3
|
+
slug: 'table_user_settings',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'User Settings',
|
|
6
|
+
description: 'Creates a user settings table for user-specific configuration. Uses AuthzDirectOwner for access control.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {}
|
|
10
|
+
},
|
|
11
|
+
tags: ['template', 'settings', 'ownership', 'schema'],
|
|
12
|
+
};
|