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/preset.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeTypeRegistryPreset = void 0;
4
+ const plugin_1 = require("graphile-settings/plugins/blueprint-types/plugin");
5
+ const index_1 = require("./index");
6
+ exports.NodeTypeRegistryPreset = {
7
+ plugins: [(0, plugin_1.createBlueprintTypesPlugin)(index_1.allNodeTypes)],
8
+ };
@@ -0,0 +1,4 @@
1
+ export { RelationBelongsTo } from './relation-belongs-to';
2
+ export { RelationHasOne } from './relation-has-one';
3
+ export { RelationHasMany } from './relation-has-many';
4
+ export { RelationManyToMany } from './relation-many-to-many';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationManyToMany = exports.RelationHasMany = exports.RelationHasOne = exports.RelationBelongsTo = void 0;
4
+ var relation_belongs_to_1 = require("./relation-belongs-to");
5
+ Object.defineProperty(exports, "RelationBelongsTo", { enumerable: true, get: function () { return relation_belongs_to_1.RelationBelongsTo; } });
6
+ var relation_has_one_1 = require("./relation-has-one");
7
+ Object.defineProperty(exports, "RelationHasOne", { enumerable: true, get: function () { return relation_has_one_1.RelationHasOne; } });
8
+ var relation_has_many_1 = require("./relation-has-many");
9
+ Object.defineProperty(exports, "RelationHasMany", { enumerable: true, get: function () { return relation_has_many_1.RelationHasMany; } });
10
+ var relation_many_to_many_1 = require("./relation-many-to-many");
11
+ Object.defineProperty(exports, "RelationManyToMany", { enumerable: true, get: function () { return relation_many_to_many_1.RelationManyToMany; } });
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const RelationBelongsTo: NodeTypeDefinition;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationBelongsTo = void 0;
4
+ exports.RelationBelongsTo = {
5
+ name: 'RelationBelongsTo',
6
+ slug: 'relation_belongs_to',
7
+ category: 'relation',
8
+ display_name: 'Belongs To',
9
+ 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.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "source_table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "Table that will have the FK field added"
17
+ },
18
+ "target_table_id": {
19
+ "type": "string",
20
+ "format": "uuid",
21
+ "description": "Table being referenced by the FK"
22
+ },
23
+ "field_name": {
24
+ "type": "string",
25
+ "description": "FK field name on the source table. Auto-derived from target table name if omitted (e.g., projects → project_id)"
26
+ },
27
+ "delete_action": {
28
+ "type": "string",
29
+ "enum": [
30
+ "c",
31
+ "r",
32
+ "n",
33
+ "d",
34
+ "a"
35
+ ],
36
+ "description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
37
+ },
38
+ "is_required": {
39
+ "type": "boolean",
40
+ "description": "Whether the FK field is NOT NULL",
41
+ "default": true
42
+ }
43
+ },
44
+ "required": [
45
+ "source_table_id",
46
+ "target_table_id",
47
+ "delete_action"
48
+ ]
49
+ },
50
+ tags: ['relation', 'foreign_key', 'schema'],
51
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const RelationHasMany: NodeTypeDefinition;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationHasMany = void 0;
4
+ exports.RelationHasMany = {
5
+ name: 'RelationHasMany',
6
+ slug: 'relation_has_many',
7
+ category: 'relation',
8
+ display_name: 'Has Many',
9
+ 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.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "source_table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "Parent table being referenced by the FK (e.g., projects in projects has many tasks)"
17
+ },
18
+ "target_table_id": {
19
+ "type": "string",
20
+ "format": "uuid",
21
+ "description": "Child table that receives the FK field (e.g., tasks in projects has many tasks)"
22
+ },
23
+ "field_name": {
24
+ "type": "string",
25
+ "description": "FK field name on the target table. Auto-derived from source table name if omitted (e.g., projects derives project_id)"
26
+ },
27
+ "delete_action": {
28
+ "type": "string",
29
+ "enum": [
30
+ "c",
31
+ "r",
32
+ "n",
33
+ "d",
34
+ "a"
35
+ ],
36
+ "description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
37
+ },
38
+ "is_required": {
39
+ "type": "boolean",
40
+ "description": "Whether the FK field is NOT NULL",
41
+ "default": true
42
+ }
43
+ },
44
+ "required": [
45
+ "source_table_id",
46
+ "target_table_id",
47
+ "delete_action"
48
+ ]
49
+ },
50
+ tags: ['relation', 'foreign_key', 'has_many', 'schema'],
51
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const RelationHasOne: NodeTypeDefinition;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationHasOne = void 0;
4
+ exports.RelationHasOne = {
5
+ name: 'RelationHasOne',
6
+ slug: 'relation_has_one',
7
+ category: 'relation',
8
+ display_name: 'Has One',
9
+ 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.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "source_table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "Table that will have the FK field and unique constraint"
17
+ },
18
+ "target_table_id": {
19
+ "type": "string",
20
+ "format": "uuid",
21
+ "description": "Table being referenced by the FK"
22
+ },
23
+ "field_name": {
24
+ "type": "string",
25
+ "description": "FK field name on the source table. Auto-derived from target table name if omitted (e.g., users → user_id)"
26
+ },
27
+ "delete_action": {
28
+ "type": "string",
29
+ "enum": [
30
+ "c",
31
+ "r",
32
+ "n",
33
+ "d",
34
+ "a"
35
+ ],
36
+ "description": "FK delete action: c=CASCADE, r=RESTRICT, n=SET NULL, d=SET DEFAULT, a=NO ACTION. Required."
37
+ },
38
+ "is_required": {
39
+ "type": "boolean",
40
+ "description": "Whether the FK field is NOT NULL",
41
+ "default": true
42
+ }
43
+ },
44
+ "required": [
45
+ "source_table_id",
46
+ "target_table_id",
47
+ "delete_action"
48
+ ]
49
+ },
50
+ tags: ['relation', 'foreign_key', 'unique', 'schema'],
51
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const RelationManyToMany: NodeTypeDefinition;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationManyToMany = void 0;
4
+ exports.RelationManyToMany = {
5
+ name: 'RelationManyToMany',
6
+ slug: 'relation_many_to_many',
7
+ category: 'relation',
8
+ display_name: 'Many to Many',
9
+ 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.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "source_table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "First table in the M:N relationship"
17
+ },
18
+ "target_table_id": {
19
+ "type": "string",
20
+ "format": "uuid",
21
+ "description": "Second table in the M:N relationship"
22
+ },
23
+ "junction_table_id": {
24
+ "type": "string",
25
+ "format": "uuid",
26
+ "description": "Existing junction table to use. If uuid_nil(), a new bare table is created"
27
+ },
28
+ "junction_table_name": {
29
+ "type": "string",
30
+ "description": "Junction table name. Auto-derived from both table names if omitted (e.g., projects + tags derives project_tags)"
31
+ },
32
+ "source_field_name": {
33
+ "type": "string",
34
+ "description": "FK field name on junction for source table. Auto-derived if omitted (e.g., projects derives project_id)"
35
+ },
36
+ "target_field_name": {
37
+ "type": "string",
38
+ "description": "FK field name on junction for target table. Auto-derived if omitted (e.g., tags derives tag_id)"
39
+ },
40
+ "use_composite_key": {
41
+ "type": "boolean",
42
+ "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.",
43
+ "default": false
44
+ },
45
+ "node_type": {
46
+ "type": "string",
47
+ "description": "Generator for field creation on junction table. Forwarded to secure_table_provision as-is. Examples: DataId, DataEntityMembership, DataDirectOwner. NULL means no additional fields."
48
+ },
49
+ "node_data": {
50
+ "type": "object",
51
+ "description": "Configuration for the generator. Forwarded to secure_table_provision as-is. Only used when node_type is set."
52
+ },
53
+ "grant_roles": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string"
57
+ },
58
+ "description": "Database roles to grant privileges to. Forwarded to secure_table_provision as-is. Default: [authenticated]"
59
+ },
60
+ "grant_privileges": {
61
+ "type": "array",
62
+ "description": "Privilege grants for the junction table. Forwarded to secure_table_provision as-is. Default: select/insert/delete for all columns"
63
+ },
64
+ "policy_type": {
65
+ "type": "string",
66
+ "description": "RLS policy type for the junction table. Forwarded to secure_table_provision as-is. NULL means no policy."
67
+ },
68
+ "policy_privileges": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ },
73
+ "description": "Privileges the policy applies to. Forwarded to secure_table_provision as-is. NULL means derived from grant_privileges verbs."
74
+ },
75
+ "policy_role": {
76
+ "type": "string",
77
+ "description": "Database role the policy targets. Forwarded to secure_table_provision as-is. NULL means falls back to first grant_role."
78
+ },
79
+ "policy_permissive": {
80
+ "type": "boolean",
81
+ "description": "Whether the policy is PERMISSIVE (true) or RESTRICTIVE (false). Forwarded to secure_table_provision as-is.",
82
+ "default": true
83
+ },
84
+ "policy_data": {
85
+ "type": "object",
86
+ "description": "Policy configuration forwarded to secure_table_provision as-is. Structure varies by policy_type."
87
+ }
88
+ },
89
+ "required": [
90
+ "source_table_id",
91
+ "target_table_id"
92
+ ]
93
+ },
94
+ tags: ['relation', 'junction', 'many_to_many', 'schema'],
95
+ };
@@ -0,0 +1,3 @@
1
+ export { TableUserProfiles } from './table-user-profiles';
2
+ export { TableOrganizationSettings } from './table-organization-settings';
3
+ export { TableUserSettings } from './table-user-settings';
package/table/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableUserSettings = exports.TableOrganizationSettings = exports.TableUserProfiles = void 0;
4
+ var table_user_profiles_1 = require("./table-user-profiles");
5
+ Object.defineProperty(exports, "TableUserProfiles", { enumerable: true, get: function () { return table_user_profiles_1.TableUserProfiles; } });
6
+ var table_organization_settings_1 = require("./table-organization-settings");
7
+ Object.defineProperty(exports, "TableOrganizationSettings", { enumerable: true, get: function () { return table_organization_settings_1.TableOrganizationSettings; } });
8
+ var table_user_settings_1 = require("./table-user-settings");
9
+ Object.defineProperty(exports, "TableUserSettings", { enumerable: true, get: function () { return table_user_settings_1.TableUserSettings; } });
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const TableOrganizationSettings: NodeTypeDefinition;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableOrganizationSettings = void 0;
4
+ exports.TableOrganizationSettings = {
5
+ name: 'TableOrganizationSettings',
6
+ slug: 'table_organization_settings',
7
+ category: 'data',
8
+ display_name: 'Organization Settings',
9
+ description: 'Creates an organization settings table with standard business fields (legal_name, address fields). Uses AuthzEntityMembership for access control.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {}
13
+ },
14
+ tags: ['template', 'settings', 'membership', 'schema'],
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const TableUserProfiles: NodeTypeDefinition;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableUserProfiles = void 0;
4
+ exports.TableUserProfiles = {
5
+ name: 'TableUserProfiles',
6
+ slug: 'table_user_profiles',
7
+ category: 'data',
8
+ display_name: 'User Profiles',
9
+ 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.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {}
13
+ },
14
+ tags: ['template', 'settings', 'ownership', 'schema'],
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const TableUserSettings: NodeTypeDefinition;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableUserSettings = void 0;
4
+ exports.TableUserSettings = {
5
+ name: 'TableUserSettings',
6
+ slug: 'table_user_settings',
7
+ category: 'data',
8
+ display_name: 'User Settings',
9
+ description: 'Creates a user settings table for user-specific configuration. Uses AuthzDirectOwner for access control.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {}
13
+ },
14
+ tags: ['template', 'settings', 'ownership', 'schema'],
15
+ };
package/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/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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';
package/view/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ViewComposite = exports.ViewAggregated = exports.ViewJoinedTables = exports.ViewFilteredTable = exports.ViewTableProjection = void 0;
4
+ var view_table_projection_1 = require("./view-table-projection");
5
+ Object.defineProperty(exports, "ViewTableProjection", { enumerable: true, get: function () { return view_table_projection_1.ViewTableProjection; } });
6
+ var view_filtered_table_1 = require("./view-filtered-table");
7
+ Object.defineProperty(exports, "ViewFilteredTable", { enumerable: true, get: function () { return view_filtered_table_1.ViewFilteredTable; } });
8
+ var view_joined_tables_1 = require("./view-joined-tables");
9
+ Object.defineProperty(exports, "ViewJoinedTables", { enumerable: true, get: function () { return view_joined_tables_1.ViewJoinedTables; } });
10
+ var view_aggregated_1 = require("./view-aggregated");
11
+ Object.defineProperty(exports, "ViewAggregated", { enumerable: true, get: function () { return view_aggregated_1.ViewAggregated; } });
12
+ var view_composite_1 = require("./view-composite");
13
+ Object.defineProperty(exports, "ViewComposite", { enumerable: true, get: function () { return view_composite_1.ViewComposite; } });
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewAggregated: NodeTypeDefinition;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ViewAggregated = void 0;
4
+ exports.ViewAggregated = {
5
+ name: 'ViewAggregated',
6
+ slug: 'view_aggregated',
7
+ category: 'view',
8
+ display_name: 'Aggregated View',
9
+ description: 'View with GROUP BY and aggregate functions. Useful for summary/reporting views.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "source_table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "UUID of the source table"
17
+ },
18
+ "group_by_fields": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ },
23
+ "description": "Field names to group by"
24
+ },
25
+ "aggregates": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "properties": {
30
+ "function": {
31
+ "type": "string",
32
+ "enum": [
33
+ "COUNT",
34
+ "SUM",
35
+ "AVG",
36
+ "MIN",
37
+ "MAX"
38
+ ]
39
+ },
40
+ "field": {
41
+ "type": "string",
42
+ "description": "Field to aggregate (or * for COUNT)"
43
+ },
44
+ "alias": {
45
+ "type": "string",
46
+ "description": "Output column name"
47
+ }
48
+ },
49
+ "required": [
50
+ "function",
51
+ "alias"
52
+ ]
53
+ },
54
+ "description": "Array of aggregate specifications"
55
+ }
56
+ },
57
+ "required": [
58
+ "source_table_id",
59
+ "group_by_fields",
60
+ "aggregates"
61
+ ]
62
+ },
63
+ tags: ['view', 'aggregate', 'reporting'],
64
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewComposite: NodeTypeDefinition;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ViewComposite = void 0;
4
+ exports.ViewComposite = {
5
+ name: 'ViewComposite',
6
+ slug: 'view_composite',
7
+ category: 'view',
8
+ display_name: 'Composite View',
9
+ description: 'Advanced view using composite AST for the query. Use when other node types are insufficient (CTEs, UNIONs, complex subqueries, etc.).',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "query_ast": {
14
+ "type": "object",
15
+ "description": "Composite SELECT query AST (JSONB)"
16
+ }
17
+ },
18
+ "required": [
19
+ "query_ast"
20
+ ]
21
+ },
22
+ tags: ['view', 'advanced', 'composite', 'ast'],
23
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewFilteredTable: NodeTypeDefinition;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ViewFilteredTable = void 0;
4
+ exports.ViewFilteredTable = {
5
+ name: 'ViewFilteredTable',
6
+ slug: 'view_filtered_table',
7
+ category: 'view',
8
+ display_name: 'Filtered Table',
9
+ description: 'Table projection with an Authz* filter baked into the view definition. The view only returns records matching the filter.',
10
+ parameter_schema: {
11
+ "type": "object",
12
+ "properties": {
13
+ "source_table_id": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "description": "UUID of the source table"
17
+ },
18
+ "filter_type": {
19
+ "type": "string",
20
+ "description": "Authz* node type name (e.g., AuthzDirectOwner, AuthzPublishable)"
21
+ },
22
+ "filter_data": {
23
+ "type": "object",
24
+ "description": "Parameters for the Authz* filter type"
25
+ },
26
+ "field_ids": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string",
30
+ "format": "uuid"
31
+ },
32
+ "description": "Optional array of field UUIDs to include (alternative to field_names)"
33
+ },
34
+ "field_names": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "string"
38
+ },
39
+ "description": "Optional array of field names to include (alternative to field_ids)"
40
+ }
41
+ },
42
+ "required": [
43
+ "source_table_id",
44
+ "filter_type"
45
+ ]
46
+ },
47
+ tags: ['view', 'filter', 'authz'],
48
+ };
@@ -0,0 +1,2 @@
1
+ import type { NodeTypeDefinition } from '../types';
2
+ export declare const ViewJoinedTables: NodeTypeDefinition;