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.
Files changed (243) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +87 -0
  3. package/authz/authz-allow-all.d.ts +2 -0
  4. package/authz/authz-allow-all.js +15 -0
  5. package/authz/authz-composite.d.ts +2 -0
  6. package/authz/authz-composite.js +39 -0
  7. package/authz/authz-deny-all.d.ts +2 -0
  8. package/authz/authz-deny-all.js +15 -0
  9. package/authz/authz-direct-owner-any.d.ts +2 -0
  10. package/authz/authz-direct-owner-any.js +26 -0
  11. package/authz/authz-direct-owner.d.ts +2 -0
  12. package/authz/authz-direct-owner.js +23 -0
  13. package/authz/authz-entity-membership.d.ts +2 -0
  14. package/authz/authz-entity-membership.js +49 -0
  15. package/authz/authz-member-list.d.ts +2 -0
  16. package/authz/authz-member-list.js +23 -0
  17. package/authz/authz-membership-check.d.ts +2 -0
  18. package/authz/authz-membership-check.js +45 -0
  19. package/authz/authz-org-hierarchy.d.ts +2 -0
  20. package/authz/authz-org-hierarchy.js +41 -0
  21. package/authz/authz-peer-ownership.d.ts +2 -0
  22. package/authz/authz-peer-ownership.js +49 -0
  23. package/authz/authz-publishable.d.ts +2 -0
  24. package/authz/authz-publishable.js +31 -0
  25. package/authz/authz-related-entity-membership.d.ts +2 -0
  26. package/authz/authz-related-entity-membership.js +71 -0
  27. package/authz/authz-related-member-list.d.ts +2 -0
  28. package/authz/authz-related-member-list.js +43 -0
  29. package/authz/authz-related-peer-ownership.d.ts +2 -0
  30. package/authz/authz-related-peer-ownership.js +75 -0
  31. package/authz/authz-temporal.d.ts +2 -0
  32. package/authz/authz-temporal.js +46 -0
  33. package/authz/index.d.ts +15 -0
  34. package/authz/index.js +33 -0
  35. package/codegen/generate-seed.d.ts +23 -0
  36. package/codegen/generate-seed.js +155 -0
  37. package/data/data-bm25.d.ts +2 -0
  38. package/data/data-bm25.js +43 -0
  39. package/data/data-direct-owner.d.ts +2 -0
  40. package/data/data-direct-owner.js +31 -0
  41. package/data/data-embedding.d.ts +2 -0
  42. package/data/data-embedding.js +82 -0
  43. package/data/data-entity-membership.d.ts +2 -0
  44. package/data/data-entity-membership.js +31 -0
  45. package/data/data-full-text-search.d.ts +2 -0
  46. package/data/data-full-text-search.js +61 -0
  47. package/data/data-id.d.ts +2 -0
  48. package/data/data-id.js +21 -0
  49. package/data/data-job-trigger.d.ts +2 -0
  50. package/data/data-job-trigger.js +111 -0
  51. package/data/data-jsonb.d.ts +2 -0
  52. package/data/data-jsonb.js +35 -0
  53. package/data/data-ownership-in-entity.d.ts +2 -0
  54. package/data/data-ownership-in-entity.js +26 -0
  55. package/data/data-peoplestamps.d.ts +2 -0
  56. package/data/data-peoplestamps.js +26 -0
  57. package/data/data-postgis-aggregate.d.ts +2 -0
  58. package/data/data-postgis-aggregate.js +94 -0
  59. package/data/data-postgis.d.ts +2 -0
  60. package/data/data-postgis.js +65 -0
  61. package/data/data-publishable.d.ts +2 -0
  62. package/data/data-publishable.js +21 -0
  63. package/data/data-search.d.ts +2 -0
  64. package/data/data-search.js +158 -0
  65. package/data/data-soft-delete.d.ts +2 -0
  66. package/data/data-soft-delete.js +21 -0
  67. package/data/data-status-field.d.ts +2 -0
  68. package/data/data-status-field.js +42 -0
  69. package/data/data-tags.d.ts +2 -0
  70. package/data/data-tags.js +30 -0
  71. package/data/data-timestamps.d.ts +2 -0
  72. package/data/data-timestamps.js +21 -0
  73. package/data/data-trgm.d.ts +2 -0
  74. package/data/data-trgm.js +26 -0
  75. package/data/index.d.ts +19 -0
  76. package/data/index.js +41 -0
  77. package/esm/authz/authz-allow-all.d.ts +2 -0
  78. package/esm/authz/authz-allow-all.js +12 -0
  79. package/esm/authz/authz-composite.d.ts +2 -0
  80. package/esm/authz/authz-composite.js +36 -0
  81. package/esm/authz/authz-deny-all.d.ts +2 -0
  82. package/esm/authz/authz-deny-all.js +12 -0
  83. package/esm/authz/authz-direct-owner-any.d.ts +2 -0
  84. package/esm/authz/authz-direct-owner-any.js +23 -0
  85. package/esm/authz/authz-direct-owner.d.ts +2 -0
  86. package/esm/authz/authz-direct-owner.js +20 -0
  87. package/esm/authz/authz-entity-membership.d.ts +2 -0
  88. package/esm/authz/authz-entity-membership.js +46 -0
  89. package/esm/authz/authz-member-list.d.ts +2 -0
  90. package/esm/authz/authz-member-list.js +20 -0
  91. package/esm/authz/authz-membership-check.d.ts +2 -0
  92. package/esm/authz/authz-membership-check.js +42 -0
  93. package/esm/authz/authz-org-hierarchy.d.ts +2 -0
  94. package/esm/authz/authz-org-hierarchy.js +38 -0
  95. package/esm/authz/authz-peer-ownership.d.ts +2 -0
  96. package/esm/authz/authz-peer-ownership.js +46 -0
  97. package/esm/authz/authz-publishable.d.ts +2 -0
  98. package/esm/authz/authz-publishable.js +28 -0
  99. package/esm/authz/authz-related-entity-membership.d.ts +2 -0
  100. package/esm/authz/authz-related-entity-membership.js +68 -0
  101. package/esm/authz/authz-related-member-list.d.ts +2 -0
  102. package/esm/authz/authz-related-member-list.js +40 -0
  103. package/esm/authz/authz-related-peer-ownership.d.ts +2 -0
  104. package/esm/authz/authz-related-peer-ownership.js +72 -0
  105. package/esm/authz/authz-temporal.d.ts +2 -0
  106. package/esm/authz/authz-temporal.js +43 -0
  107. package/esm/authz/index.d.ts +15 -0
  108. package/esm/authz/index.js +15 -0
  109. package/esm/codegen/generate-seed.d.ts +23 -0
  110. package/esm/codegen/generate-seed.js +153 -0
  111. package/esm/data/data-bm25.d.ts +2 -0
  112. package/esm/data/data-bm25.js +40 -0
  113. package/esm/data/data-direct-owner.d.ts +2 -0
  114. package/esm/data/data-direct-owner.js +28 -0
  115. package/esm/data/data-embedding.d.ts +2 -0
  116. package/esm/data/data-embedding.js +79 -0
  117. package/esm/data/data-entity-membership.d.ts +2 -0
  118. package/esm/data/data-entity-membership.js +28 -0
  119. package/esm/data/data-full-text-search.d.ts +2 -0
  120. package/esm/data/data-full-text-search.js +58 -0
  121. package/esm/data/data-id.d.ts +2 -0
  122. package/esm/data/data-id.js +18 -0
  123. package/esm/data/data-job-trigger.d.ts +2 -0
  124. package/esm/data/data-job-trigger.js +108 -0
  125. package/esm/data/data-jsonb.d.ts +2 -0
  126. package/esm/data/data-jsonb.js +32 -0
  127. package/esm/data/data-ownership-in-entity.d.ts +2 -0
  128. package/esm/data/data-ownership-in-entity.js +23 -0
  129. package/esm/data/data-peoplestamps.d.ts +2 -0
  130. package/esm/data/data-peoplestamps.js +23 -0
  131. package/esm/data/data-postgis-aggregate.d.ts +2 -0
  132. package/esm/data/data-postgis-aggregate.js +91 -0
  133. package/esm/data/data-postgis.d.ts +2 -0
  134. package/esm/data/data-postgis.js +62 -0
  135. package/esm/data/data-publishable.d.ts +2 -0
  136. package/esm/data/data-publishable.js +18 -0
  137. package/esm/data/data-search.d.ts +2 -0
  138. package/esm/data/data-search.js +155 -0
  139. package/esm/data/data-soft-delete.d.ts +2 -0
  140. package/esm/data/data-soft-delete.js +18 -0
  141. package/esm/data/data-status-field.d.ts +2 -0
  142. package/esm/data/data-status-field.js +39 -0
  143. package/esm/data/data-tags.d.ts +2 -0
  144. package/esm/data/data-tags.js +27 -0
  145. package/esm/data/data-timestamps.d.ts +2 -0
  146. package/esm/data/data-timestamps.js +18 -0
  147. package/esm/data/data-trgm.d.ts +2 -0
  148. package/esm/data/data-trgm.js +23 -0
  149. package/esm/data/index.d.ts +19 -0
  150. package/esm/data/index.js +19 -0
  151. package/esm/field/field-immutable.d.ts +2 -0
  152. package/esm/field/field-immutable.js +21 -0
  153. package/esm/field/field-inflection.d.ts +2 -0
  154. package/esm/field/field-inflection.js +29 -0
  155. package/esm/field/field-owned.d.ts +2 -0
  156. package/esm/field/field-owned.js +36 -0
  157. package/esm/field/field-slug.d.ts +2 -0
  158. package/esm/field/field-slug.js +26 -0
  159. package/esm/field/index.d.ts +4 -0
  160. package/esm/field/index.js +4 -0
  161. package/esm/index.d.ts +9 -0
  162. package/esm/index.js +21 -0
  163. package/esm/preset.d.ts +23 -0
  164. package/esm/preset.js +5 -0
  165. package/esm/relation/index.d.ts +4 -0
  166. package/esm/relation/index.js +4 -0
  167. package/esm/relation/relation-belongs-to.d.ts +2 -0
  168. package/esm/relation/relation-belongs-to.js +48 -0
  169. package/esm/relation/relation-has-many.d.ts +2 -0
  170. package/esm/relation/relation-has-many.js +48 -0
  171. package/esm/relation/relation-has-one.d.ts +2 -0
  172. package/esm/relation/relation-has-one.js +48 -0
  173. package/esm/relation/relation-many-to-many.d.ts +2 -0
  174. package/esm/relation/relation-many-to-many.js +92 -0
  175. package/esm/table/index.d.ts +3 -0
  176. package/esm/table/index.js +3 -0
  177. package/esm/table/table-organization-settings.d.ts +2 -0
  178. package/esm/table/table-organization-settings.js +12 -0
  179. package/esm/table/table-user-profiles.d.ts +2 -0
  180. package/esm/table/table-user-profiles.js +12 -0
  181. package/esm/table/table-user-settings.d.ts +2 -0
  182. package/esm/table/table-user-settings.js +12 -0
  183. package/esm/types.d.ts +61 -0
  184. package/esm/types.js +1 -0
  185. package/esm/view/index.d.ts +5 -0
  186. package/esm/view/index.js +5 -0
  187. package/esm/view/view-aggregated.d.ts +2 -0
  188. package/esm/view/view-aggregated.js +61 -0
  189. package/esm/view/view-composite.d.ts +2 -0
  190. package/esm/view/view-composite.js +20 -0
  191. package/esm/view/view-filtered-table.d.ts +2 -0
  192. package/esm/view/view-filtered-table.js +45 -0
  193. package/esm/view/view-joined-tables.d.ts +2 -0
  194. package/esm/view/view-joined-tables.js +80 -0
  195. package/esm/view/view-table-projection.d.ts +2 -0
  196. package/esm/view/view-table-projection.js +36 -0
  197. package/field/field-immutable.d.ts +2 -0
  198. package/field/field-immutable.js +24 -0
  199. package/field/field-inflection.d.ts +2 -0
  200. package/field/field-inflection.js +32 -0
  201. package/field/field-owned.d.ts +2 -0
  202. package/field/field-owned.js +39 -0
  203. package/field/field-slug.d.ts +2 -0
  204. package/field/field-slug.js +29 -0
  205. package/field/index.d.ts +4 -0
  206. package/field/index.js +11 -0
  207. package/index.d.ts +9 -0
  208. package/index.js +60 -0
  209. package/package.json +49 -0
  210. package/preset.d.ts +23 -0
  211. package/preset.js +8 -0
  212. package/relation/index.d.ts +4 -0
  213. package/relation/index.js +11 -0
  214. package/relation/relation-belongs-to.d.ts +2 -0
  215. package/relation/relation-belongs-to.js +51 -0
  216. package/relation/relation-has-many.d.ts +2 -0
  217. package/relation/relation-has-many.js +51 -0
  218. package/relation/relation-has-one.d.ts +2 -0
  219. package/relation/relation-has-one.js +51 -0
  220. package/relation/relation-many-to-many.d.ts +2 -0
  221. package/relation/relation-many-to-many.js +95 -0
  222. package/table/index.d.ts +3 -0
  223. package/table/index.js +9 -0
  224. package/table/table-organization-settings.d.ts +2 -0
  225. package/table/table-organization-settings.js +15 -0
  226. package/table/table-user-profiles.d.ts +2 -0
  227. package/table/table-user-profiles.js +15 -0
  228. package/table/table-user-settings.d.ts +2 -0
  229. package/table/table-user-settings.js +15 -0
  230. package/types.d.ts +61 -0
  231. package/types.js +2 -0
  232. package/view/index.d.ts +5 -0
  233. package/view/index.js +13 -0
  234. package/view/view-aggregated.d.ts +2 -0
  235. package/view/view-aggregated.js +64 -0
  236. package/view/view-composite.d.ts +2 -0
  237. package/view/view-composite.js +23 -0
  238. package/view/view-filtered-table.d.ts +2 -0
  239. package/view/view-filtered-table.js +48 -0
  240. package/view/view-joined-tables.d.ts +2 -0
  241. package/view/view-joined-tables.js +83 -0
  242. package/view/view-table-projection.d.ts +2 -0
  243. package/view/view-table-projection.js +39 -0
package/esm/types.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ /**
2
+ * JSON Schema type definition.
3
+ *
4
+ * Inline subset matching the shape used by schema-typescript in dev-utils.
5
+ * We copy it here to avoid an external dependency.
6
+ */
7
+ export interface JSONSchema {
8
+ $schema?: string;
9
+ $ref?: string;
10
+ title?: string;
11
+ properties?: {
12
+ [key: string]: JSONSchema;
13
+ };
14
+ required?: string[];
15
+ type?: string | string[];
16
+ const?: string;
17
+ enum?: (string | number | boolean)[];
18
+ items?: JSONSchema | JSONSchema[];
19
+ $defs?: {
20
+ [key: string]: JSONSchema;
21
+ };
22
+ definitions?: {
23
+ [key: string]: JSONSchema;
24
+ };
25
+ additionalProperties?: boolean | JSONSchema;
26
+ anyOf?: JSONSchema[];
27
+ allOf?: JSONSchema[];
28
+ oneOf?: JSONSchema[];
29
+ description?: string;
30
+ default?: unknown;
31
+ [key: string]: unknown;
32
+ format?: string;
33
+ }
34
+ /**
35
+ * A single node type definition in the registry.
36
+ *
37
+ * Each node type describes a reusable building block for blueprints:
38
+ * authorization policies (Authz*), data behaviors (Data*), field
39
+ * constraints (Field*), relations (Relation*), views (View*), or
40
+ * table templates (Table*).
41
+ *
42
+ * All keys use snake_case to match the server-side SQL convention.
43
+ * The parameter_schema uses JSON Schema to describe the node's
44
+ * configuration shape — these keys are also snake_case.
45
+ */
46
+ export interface NodeTypeDefinition {
47
+ /** PascalCase name, e.g. 'AuthzDirectOwner' */
48
+ name: string;
49
+ /** snake_case slug, e.g. 'authz_direct_owner' */
50
+ slug: string;
51
+ /** Category: authz | data | field | relation | view */
52
+ category: string;
53
+ /** Human-readable display name, e.g. 'Direct Ownership' */
54
+ display_name: string;
55
+ /** Description of what this node type does */
56
+ description: string;
57
+ /** JSON Schema defining the parameter shape (all keys are snake_case) */
58
+ parameter_schema: JSONSchema;
59
+ /** Tags for categorization and filtering */
60
+ tags: string[];
61
+ }
package/esm/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export { ViewTableProjection } from './view-table-projection';
2
+ export { ViewFilteredTable } from './view-filtered-table';
3
+ export { ViewJoinedTables } from './view-joined-tables';
4
+ export { ViewAggregated } from './view-aggregated';
5
+ export { ViewComposite } from './view-composite';
@@ -0,0 +1,5 @@
1
+ export { ViewTableProjection } from './view-table-projection';
2
+ export { ViewFilteredTable } from './view-filtered-table';
3
+ export { ViewJoinedTables } from './view-joined-tables';
4
+ export { ViewAggregated } from './view-aggregated';
5
+ export { ViewComposite } from './view-composite';
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewAggregated: NodeTypeDefinition;
@@ -0,0 +1,61 @@
1
+ export const ViewAggregated = {
2
+ name: 'ViewAggregated',
3
+ slug: 'view_aggregated',
4
+ category: 'view',
5
+ display_name: 'Aggregated View',
6
+ description: 'View with GROUP BY and aggregate functions. Useful for summary/reporting views.',
7
+ parameter_schema: {
8
+ "type": "object",
9
+ "properties": {
10
+ "source_table_id": {
11
+ "type": "string",
12
+ "format": "uuid",
13
+ "description": "UUID of the source table"
14
+ },
15
+ "group_by_fields": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string"
19
+ },
20
+ "description": "Field names to group by"
21
+ },
22
+ "aggregates": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "function": {
28
+ "type": "string",
29
+ "enum": [
30
+ "COUNT",
31
+ "SUM",
32
+ "AVG",
33
+ "MIN",
34
+ "MAX"
35
+ ]
36
+ },
37
+ "field": {
38
+ "type": "string",
39
+ "description": "Field to aggregate (or * for COUNT)"
40
+ },
41
+ "alias": {
42
+ "type": "string",
43
+ "description": "Output column name"
44
+ }
45
+ },
46
+ "required": [
47
+ "function",
48
+ "alias"
49
+ ]
50
+ },
51
+ "description": "Array of aggregate specifications"
52
+ }
53
+ },
54
+ "required": [
55
+ "source_table_id",
56
+ "group_by_fields",
57
+ "aggregates"
58
+ ]
59
+ },
60
+ tags: ['view', 'aggregate', 'reporting'],
61
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewComposite: NodeTypeDefinition;
@@ -0,0 +1,20 @@
1
+ export const ViewComposite = {
2
+ name: 'ViewComposite',
3
+ slug: 'view_composite',
4
+ category: 'view',
5
+ display_name: 'Composite View',
6
+ description: 'Advanced view using composite AST for the query. Use when other node types are insufficient (CTEs, UNIONs, complex subqueries, etc.).',
7
+ parameter_schema: {
8
+ "type": "object",
9
+ "properties": {
10
+ "query_ast": {
11
+ "type": "object",
12
+ "description": "Composite SELECT query AST (JSONB)"
13
+ }
14
+ },
15
+ "required": [
16
+ "query_ast"
17
+ ]
18
+ },
19
+ tags: ['view', 'advanced', 'composite', 'ast'],
20
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewFilteredTable: NodeTypeDefinition;
@@ -0,0 +1,45 @@
1
+ export const ViewFilteredTable = {
2
+ name: 'ViewFilteredTable',
3
+ slug: 'view_filtered_table',
4
+ category: 'view',
5
+ display_name: 'Filtered Table',
6
+ description: 'Table projection with an Authz* filter baked into the view definition. The view only returns records matching the filter.',
7
+ parameter_schema: {
8
+ "type": "object",
9
+ "properties": {
10
+ "source_table_id": {
11
+ "type": "string",
12
+ "format": "uuid",
13
+ "description": "UUID of the source table"
14
+ },
15
+ "filter_type": {
16
+ "type": "string",
17
+ "description": "Authz* node type name (e.g., AuthzDirectOwner, AuthzPublishable)"
18
+ },
19
+ "filter_data": {
20
+ "type": "object",
21
+ "description": "Parameters for the Authz* filter type"
22
+ },
23
+ "field_ids": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "string",
27
+ "format": "uuid"
28
+ },
29
+ "description": "Optional array of field UUIDs to include (alternative to field_names)"
30
+ },
31
+ "field_names": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ },
36
+ "description": "Optional array of field names to include (alternative to field_ids)"
37
+ }
38
+ },
39
+ "required": [
40
+ "source_table_id",
41
+ "filter_type"
42
+ ]
43
+ },
44
+ tags: ['view', 'filter', 'authz'],
45
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewJoinedTables: NodeTypeDefinition;
@@ -0,0 +1,80 @@
1
+ export const ViewJoinedTables = {
2
+ name: 'ViewJoinedTables',
3
+ slug: 'view_joined_tables',
4
+ category: 'view',
5
+ display_name: 'Joined Tables',
6
+ description: 'View that joins multiple tables together. Supports INNER, LEFT, RIGHT, and FULL joins.',
7
+ parameter_schema: {
8
+ "type": "object",
9
+ "properties": {
10
+ "primary_table_id": {
11
+ "type": "string",
12
+ "format": "uuid",
13
+ "description": "UUID of the primary (left-most) table"
14
+ },
15
+ "primary_columns": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string"
19
+ },
20
+ "description": "Optional array of column names to include from the primary table"
21
+ },
22
+ "joins": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "table_id": {
28
+ "type": "string",
29
+ "format": "uuid",
30
+ "description": "UUID of the joined table"
31
+ },
32
+ "join_type": {
33
+ "type": "string",
34
+ "enum": [
35
+ "INNER",
36
+ "LEFT",
37
+ "RIGHT",
38
+ "FULL"
39
+ ]
40
+ },
41
+ "primary_field": {
42
+ "type": "string",
43
+ "description": "Field on primary table"
44
+ },
45
+ "join_field": {
46
+ "type": "string",
47
+ "description": "Field on joined table"
48
+ },
49
+ "columns": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string"
53
+ },
54
+ "description": "Optional column names to include from this joined table"
55
+ }
56
+ },
57
+ "required": [
58
+ "table_id",
59
+ "primary_field",
60
+ "join_field"
61
+ ]
62
+ },
63
+ "description": "Array of join specifications"
64
+ },
65
+ "field_ids": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string",
69
+ "format": "uuid"
70
+ },
71
+ "description": "Optional array of field UUIDs to include (alternative to per-table columns)"
72
+ }
73
+ },
74
+ "required": [
75
+ "primary_table_id",
76
+ "joins"
77
+ ]
78
+ },
79
+ tags: ['view', 'join'],
80
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewTableProjection: NodeTypeDefinition;
@@ -0,0 +1,36 @@
1
+ export const ViewTableProjection = {
2
+ name: 'ViewTableProjection',
3
+ slug: 'view_table_projection',
4
+ category: 'view',
5
+ display_name: 'Table Projection',
6
+ description: 'Simple column selection from a single source table. Projects all or specific fields.',
7
+ parameter_schema: {
8
+ "type": "object",
9
+ "properties": {
10
+ "source_table_id": {
11
+ "type": "string",
12
+ "format": "uuid",
13
+ "description": "UUID of the source table to project from"
14
+ },
15
+ "field_ids": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string",
19
+ "format": "uuid"
20
+ },
21
+ "description": "Optional array of field UUIDs to include (all fields if omitted)"
22
+ },
23
+ "field_names": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "string"
27
+ },
28
+ "description": "Optional array of field names to include (alternative to field_ids)"
29
+ }
30
+ },
31
+ "required": [
32
+ "source_table_id"
33
+ ]
34
+ },
35
+ tags: ['view', 'projection'],
36
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const FieldImmutable: NodeTypeDefinition;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldImmutable = void 0;
4
+ exports.FieldImmutable = {
5
+ name: 'FieldImmutable',
6
+ slug: 'field_immutable',
7
+ category: 'field',
8
+ display_name: 'Immutable',
9
+ description: 'Prevents a field from being modified after initial insert.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "field_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "UUID of the field that cannot be updated"
17
+ }
18
+ },
19
+ "required": [
20
+ "field_id"
21
+ ]
22
+ },
23
+ tags: ['constraint', 'behavior'],
24
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const FieldInflection: NodeTypeDefinition;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldInflection = void 0;
4
+ exports.FieldInflection = {
5
+ name: 'FieldInflection',
6
+ slug: 'field_inflection',
7
+ category: 'field',
8
+ display_name: 'Inflection',
9
+ description: 'Transforms field values using inflection operations (snake_case, camelCase, etc).',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "field_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "Target field"
17
+ },
18
+ "ops": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ },
23
+ "description": "Inflection operations to apply"
24
+ }
25
+ },
26
+ "required": [
27
+ "field_id",
28
+ "ops"
29
+ ]
30
+ },
31
+ tags: ['transform', 'behavior'],
32
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const FieldOwned: NodeTypeDefinition;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldOwned = void 0;
4
+ exports.FieldOwned = {
5
+ name: 'FieldOwned',
6
+ slug: 'field_owned',
7
+ category: 'field',
8
+ display_name: 'Owned',
9
+ 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.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "Target table"
17
+ },
18
+ "role_key_field_id": {
19
+ "type": "string",
20
+ "format": "uuid",
21
+ "description": "Field identifying the owner (e.g., sender_id)"
22
+ },
23
+ "protected_field_ids": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "string",
27
+ "format": "uuid"
28
+ },
29
+ "description": "Fields only this owner can modify"
30
+ }
31
+ },
32
+ "required": [
33
+ "table_id",
34
+ "role_key_field_id",
35
+ "protected_field_ids"
36
+ ]
37
+ },
38
+ tags: ['ownership', 'constraint', 'behavior'],
39
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const FieldSlug: NodeTypeDefinition;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldSlug = void 0;
4
+ exports.FieldSlug = {
5
+ name: 'FieldSlug',
6
+ slug: 'field_slug',
7
+ category: 'field',
8
+ display_name: 'Slug',
9
+ description: 'Auto-generates URL-friendly slugs from field values on insert/update.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "field_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "Target field to slugify"
17
+ },
18
+ "source_field_id": {
19
+ "type": "string",
20
+ "format": "uuid",
21
+ "description": "Optional source field (defaults to target)"
22
+ }
23
+ },
24
+ "required": [
25
+ "field_id"
26
+ ]
27
+ },
28
+ tags: ['transform', 'behavior'],
29
+ };
@@ -0,0 +1,4 @@
1
+ export { FieldImmutable } from './field-immutable';
2
+ export { FieldSlug } from './field-slug';
3
+ export { FieldInflection } from './field-inflection';
4
+ export { FieldOwned } from './field-owned';
package/field/index.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldOwned = exports.FieldInflection = exports.FieldSlug = exports.FieldImmutable = void 0;
4
+ var field_immutable_1 = require("./field-immutable");
5
+ Object.defineProperty(exports, "FieldImmutable", { enumerable: true, get: function () { return field_immutable_1.FieldImmutable; } });
6
+ var field_slug_1 = require("./field-slug");
7
+ Object.defineProperty(exports, "FieldSlug", { enumerable: true, get: function () { return field_slug_1.FieldSlug; } });
8
+ var field_inflection_1 = require("./field-inflection");
9
+ Object.defineProperty(exports, "FieldInflection", { enumerable: true, get: function () { return field_inflection_1.FieldInflection; } });
10
+ var field_owned_1 = require("./field-owned");
11
+ Object.defineProperty(exports, "FieldOwned", { enumerable: true, get: function () { return field_owned_1.FieldOwned; } });
package/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/index.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.allNodeTypes = void 0;
40
+ // Re-export all node definitions by category
41
+ __exportStar(require("./authz"), exports);
42
+ __exportStar(require("./data"), exports);
43
+ __exportStar(require("./field"), exports);
44
+ __exportStar(require("./relation"), exports);
45
+ __exportStar(require("./view"), exports);
46
+ __exportStar(require("./table"), exports);
47
+ const authz = __importStar(require("./authz"));
48
+ const data = __importStar(require("./data"));
49
+ const field = __importStar(require("./field"));
50
+ const relation = __importStar(require("./relation"));
51
+ const view = __importStar(require("./view"));
52
+ const table = __importStar(require("./table"));
53
+ exports.allNodeTypes = [
54
+ ...Object.values(authz),
55
+ ...Object.values(data),
56
+ ...Object.values(field),
57
+ ...Object.values(relation),
58
+ ...Object.values(view),
59
+ ...Object.values(table),
60
+ ];
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "node-type-registry",
3
+ "version": "0.2.0",
4
+ "description": "Node type definitions for the Constructive blueprint system. Single source of truth for all Authz*, Data*, Field*, Relation*, View*, and Table* node types.",
5
+ "author": "Constructive <developers@constructive.io>",
6
+ "main": "index.js",
7
+ "module": "esm/index.js",
8
+ "types": "index.d.ts",
9
+ "homepage": "https://github.com/constructive-io/constructive",
10
+ "license": "MIT",
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "directory": "dist"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/constructive-io/constructive"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/constructive-io/constructive/issues"
21
+ },
22
+ "scripts": {
23
+ "clean": "makage clean",
24
+ "prepack": "npm run build",
25
+ "build": "makage build",
26
+ "build:dev": "makage build --dev",
27
+ "lint": "eslint . --fix",
28
+ "test": "jest",
29
+ "test:watch": "jest --watch"
30
+ },
31
+ "dependencies": {
32
+ "@pgsql/types": "^17.6.2",
33
+ "@pgsql/utils": "^17.8.14",
34
+ "graphile-config": "1.0.0-rc.6",
35
+ "graphile-settings": "^4.14.0",
36
+ "pgsql-deparser": "^17.18.1"
37
+ },
38
+ "devDependencies": {
39
+ "makage": "^0.1.10"
40
+ },
41
+ "keywords": [
42
+ "constructive",
43
+ "blueprint",
44
+ "node-type",
45
+ "registry",
46
+ "graphile"
47
+ ],
48
+ "gitHead": "6eb4389816805b64af3a2aa18b29a08f37bb013f"
49
+ }
package/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;