@pattern-stack/codegen 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 (279) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +214 -0
  3. package/dist/runtime/analytics/index.d.ts +6 -0
  4. package/dist/runtime/analytics/index.js +49 -0
  5. package/dist/runtime/analytics/index.js.map +1 -0
  6. package/dist/runtime/analytics/metrics.d.ts +75 -0
  7. package/dist/runtime/analytics/metrics.js +1 -0
  8. package/dist/runtime/analytics/metrics.js.map +1 -0
  9. package/dist/runtime/analytics/packs/crm-entity-measures.d.ts +21 -0
  10. package/dist/runtime/analytics/packs/crm-entity-measures.js +1 -0
  11. package/dist/runtime/analytics/packs/crm-entity-measures.js.map +1 -0
  12. package/dist/runtime/analytics/packs/index.d.ts +3 -0
  13. package/dist/runtime/analytics/packs/index.js +1 -0
  14. package/dist/runtime/analytics/packs/index.js.map +1 -0
  15. package/dist/runtime/analytics/packs/monetary-measures.d.ts +21 -0
  16. package/dist/runtime/analytics/packs/monetary-measures.js +1 -0
  17. package/dist/runtime/analytics/packs/monetary-measures.js.map +1 -0
  18. package/dist/runtime/analytics/specs.d.ts +49 -0
  19. package/dist/runtime/analytics/specs.js +1 -0
  20. package/dist/runtime/analytics/specs.js.map +1 -0
  21. package/dist/runtime/analytics/types.d.ts +85 -0
  22. package/dist/runtime/analytics/types.js +49 -0
  23. package/dist/runtime/analytics/types.js.map +1 -0
  24. package/dist/runtime/base-classes/activity-entity-repository.d.ts +26 -0
  25. package/dist/runtime/base-classes/activity-entity-repository.js +195 -0
  26. package/dist/runtime/base-classes/activity-entity-repository.js.map +1 -0
  27. package/dist/runtime/base-classes/activity-entity-service.d.ts +39 -0
  28. package/dist/runtime/base-classes/activity-entity-service.js +214 -0
  29. package/dist/runtime/base-classes/activity-entity-service.js.map +1 -0
  30. package/dist/runtime/base-classes/base-read-use-cases.d.ts +68 -0
  31. package/dist/runtime/base-classes/base-read-use-cases.js +32 -0
  32. package/dist/runtime/base-classes/base-read-use-cases.js.map +1 -0
  33. package/dist/runtime/base-classes/base-repository.d.ts +99 -0
  34. package/dist/runtime/base-classes/base-repository.js +160 -0
  35. package/dist/runtime/base-classes/base-repository.js.map +1 -0
  36. package/dist/runtime/base-classes/base-service.d.ts +98 -0
  37. package/dist/runtime/base-classes/base-service.js +186 -0
  38. package/dist/runtime/base-classes/base-service.js.map +1 -0
  39. package/dist/runtime/base-classes/index.d.ts +18 -0
  40. package/dist/runtime/base-classes/index.js +617 -0
  41. package/dist/runtime/base-classes/index.js.map +1 -0
  42. package/dist/runtime/base-classes/knowledge-entity-repository.d.ts +17 -0
  43. package/dist/runtime/base-classes/knowledge-entity-repository.js +166 -0
  44. package/dist/runtime/base-classes/knowledge-entity-repository.js.map +1 -0
  45. package/dist/runtime/base-classes/knowledge-entity-service.d.ts +15 -0
  46. package/dist/runtime/base-classes/knowledge-entity-service.js +192 -0
  47. package/dist/runtime/base-classes/knowledge-entity-service.js.map +1 -0
  48. package/dist/runtime/base-classes/lifecycle-events.d.ts +49 -0
  49. package/dist/runtime/base-classes/lifecycle-events.js +76 -0
  50. package/dist/runtime/base-classes/lifecycle-events.js.map +1 -0
  51. package/dist/runtime/base-classes/metadata-entity-repository.d.ts +27 -0
  52. package/dist/runtime/base-classes/metadata-entity-repository.js +212 -0
  53. package/dist/runtime/base-classes/metadata-entity-repository.js.map +1 -0
  54. package/dist/runtime/base-classes/metadata-entity-service.d.ts +39 -0
  55. package/dist/runtime/base-classes/metadata-entity-service.js +214 -0
  56. package/dist/runtime/base-classes/metadata-entity-service.js.map +1 -0
  57. package/dist/runtime/base-classes/synced-entity-repository.d.ts +32 -0
  58. package/dist/runtime/base-classes/synced-entity-repository.js +203 -0
  59. package/dist/runtime/base-classes/synced-entity-repository.js.map +1 -0
  60. package/dist/runtime/base-classes/synced-entity-service.d.ts +41 -0
  61. package/dist/runtime/base-classes/synced-entity-service.js +215 -0
  62. package/dist/runtime/base-classes/synced-entity-service.js.map +1 -0
  63. package/dist/runtime/base-classes/with-analytics.d.ts +18 -0
  64. package/dist/runtime/base-classes/with-analytics.js +11 -0
  65. package/dist/runtime/base-classes/with-analytics.js.map +1 -0
  66. package/dist/runtime/constants/tokens.d.ts +29 -0
  67. package/dist/runtime/constants/tokens.js +8 -0
  68. package/dist/runtime/constants/tokens.js.map +1 -0
  69. package/dist/runtime/subsystems/analytics/analytics-query.protocol.d.ts +30 -0
  70. package/dist/runtime/subsystems/analytics/analytics-query.protocol.js +1 -0
  71. package/dist/runtime/subsystems/analytics/analytics-query.protocol.js.map +1 -0
  72. package/dist/runtime/subsystems/analytics/analytics.module.d.ts +34 -0
  73. package/dist/runtime/subsystems/analytics/analytics.module.js +117 -0
  74. package/dist/runtime/subsystems/analytics/analytics.module.js.map +1 -0
  75. package/dist/runtime/subsystems/analytics/analytics.tokens.d.ts +24 -0
  76. package/dist/runtime/subsystems/analytics/analytics.tokens.js +10 -0
  77. package/dist/runtime/subsystems/analytics/analytics.tokens.js.map +1 -0
  78. package/dist/runtime/subsystems/analytics/cube-backend.d.ts +28 -0
  79. package/dist/runtime/subsystems/analytics/cube-backend.js +71 -0
  80. package/dist/runtime/subsystems/analytics/cube-backend.js.map +1 -0
  81. package/dist/runtime/subsystems/analytics/index.d.ts +6 -0
  82. package/dist/runtime/subsystems/analytics/index.js +122 -0
  83. package/dist/runtime/subsystems/analytics/index.js.map +1 -0
  84. package/dist/runtime/subsystems/analytics/noop-backend.d.ts +7 -0
  85. package/dist/runtime/subsystems/analytics/noop-backend.js +25 -0
  86. package/dist/runtime/subsystems/analytics/noop-backend.js.map +1 -0
  87. package/dist/runtime/subsystems/cache/cache.drizzle-backend.d.ts +43 -0
  88. package/dist/runtime/subsystems/cache/cache.drizzle-backend.js +133 -0
  89. package/dist/runtime/subsystems/cache/cache.drizzle-backend.js.map +1 -0
  90. package/dist/runtime/subsystems/cache/cache.memory-backend.d.ts +21 -0
  91. package/dist/runtime/subsystems/cache/cache.memory-backend.js +100 -0
  92. package/dist/runtime/subsystems/cache/cache.memory-backend.js.map +1 -0
  93. package/dist/runtime/subsystems/cache/cache.module.d.ts +37 -0
  94. package/dist/runtime/subsystems/cache/cache.module.js +272 -0
  95. package/dist/runtime/subsystems/cache/cache.module.js.map +1 -0
  96. package/dist/runtime/subsystems/cache/cache.protocol.d.ts +42 -0
  97. package/dist/runtime/subsystems/cache/cache.protocol.js +1 -0
  98. package/dist/runtime/subsystems/cache/cache.protocol.js.map +1 -0
  99. package/dist/runtime/subsystems/cache/cache.schema.d.ts +64 -0
  100. package/dist/runtime/subsystems/cache/cache.schema.js +18 -0
  101. package/dist/runtime/subsystems/cache/cache.schema.js.map +1 -0
  102. package/dist/runtime/subsystems/cache/cache.tokens.d.ts +18 -0
  103. package/dist/runtime/subsystems/cache/cache.tokens.js +8 -0
  104. package/dist/runtime/subsystems/cache/cache.tokens.js.map +1 -0
  105. package/dist/runtime/subsystems/cache/index.d.ts +11 -0
  106. package/dist/runtime/subsystems/cache/index.js +277 -0
  107. package/dist/runtime/subsystems/cache/index.js.map +1 -0
  108. package/dist/runtime/subsystems/events/domain-events.schema.d.ts +187 -0
  109. package/dist/runtime/subsystems/events/domain-events.schema.js +32 -0
  110. package/dist/runtime/subsystems/events/domain-events.schema.js.map +1 -0
  111. package/dist/runtime/subsystems/events/event-bus.drizzle-backend.d.ts +38 -0
  112. package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js +199 -0
  113. package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js.map +1 -0
  114. package/dist/runtime/subsystems/events/event-bus.memory-backend.d.ts +18 -0
  115. package/dist/runtime/subsystems/events/event-bus.memory-backend.js +71 -0
  116. package/dist/runtime/subsystems/events/event-bus.memory-backend.js.map +1 -0
  117. package/dist/runtime/subsystems/events/event-bus.protocol.d.ts +52 -0
  118. package/dist/runtime/subsystems/events/event-bus.protocol.js +1 -0
  119. package/dist/runtime/subsystems/events/event-bus.protocol.js.map +1 -0
  120. package/dist/runtime/subsystems/events/event-bus.redis-backend.d.ts +95 -0
  121. package/dist/runtime/subsystems/events/event-bus.redis-backend.js +229 -0
  122. package/dist/runtime/subsystems/events/event-bus.redis-backend.js.map +1 -0
  123. package/dist/runtime/subsystems/events/events.module.d.ts +46 -0
  124. package/dist/runtime/subsystems/events/events.module.js +531 -0
  125. package/dist/runtime/subsystems/events/events.module.js.map +1 -0
  126. package/dist/runtime/subsystems/events/events.tokens.d.ts +19 -0
  127. package/dist/runtime/subsystems/events/events.tokens.js +8 -0
  128. package/dist/runtime/subsystems/events/events.tokens.js.map +1 -0
  129. package/dist/runtime/subsystems/events/index.d.ts +12 -0
  130. package/dist/runtime/subsystems/events/index.js +536 -0
  131. package/dist/runtime/subsystems/events/index.js.map +1 -0
  132. package/dist/runtime/subsystems/index.d.ts +24 -0
  133. package/dist/runtime/subsystems/index.js +1643 -0
  134. package/dist/runtime/subsystems/index.js.map +1 -0
  135. package/dist/runtime/subsystems/jobs/index.d.ts +14 -0
  136. package/dist/runtime/subsystems/jobs/index.js +680 -0
  137. package/dist/runtime/subsystems/jobs/index.js.map +1 -0
  138. package/dist/runtime/subsystems/jobs/job-queue.bullmq-backend.d.ts +54 -0
  139. package/dist/runtime/subsystems/jobs/job-queue.bullmq-backend.js +186 -0
  140. package/dist/runtime/subsystems/jobs/job-queue.bullmq-backend.js.map +1 -0
  141. package/dist/runtime/subsystems/jobs/job-queue.drizzle-backend.d.ts +38 -0
  142. package/dist/runtime/subsystems/jobs/job-queue.drizzle-backend.js +228 -0
  143. package/dist/runtime/subsystems/jobs/job-queue.drizzle-backend.js.map +1 -0
  144. package/dist/runtime/subsystems/jobs/job-queue.memory-backend.d.ts +12 -0
  145. package/dist/runtime/subsystems/jobs/job-queue.memory-backend.js +44 -0
  146. package/dist/runtime/subsystems/jobs/job-queue.memory-backend.js.map +1 -0
  147. package/dist/runtime/subsystems/jobs/job-queue.protocol.d.ts +48 -0
  148. package/dist/runtime/subsystems/jobs/job-queue.protocol.js +1 -0
  149. package/dist/runtime/subsystems/jobs/job-queue.protocol.js.map +1 -0
  150. package/dist/runtime/subsystems/jobs/job-queue.redis-backend.d.ts +46 -0
  151. package/dist/runtime/subsystems/jobs/job-queue.redis-backend.js +187 -0
  152. package/dist/runtime/subsystems/jobs/job-queue.redis-backend.js.map +1 -0
  153. package/dist/runtime/subsystems/jobs/job-queue.schema.d.ts +237 -0
  154. package/dist/runtime/subsystems/jobs/job-queue.schema.js +44 -0
  155. package/dist/runtime/subsystems/jobs/job-queue.schema.js.map +1 -0
  156. package/dist/runtime/subsystems/jobs/jobs.module.d.ts +18 -0
  157. package/dist/runtime/subsystems/jobs/jobs.module.js +676 -0
  158. package/dist/runtime/subsystems/jobs/jobs.module.js.map +1 -0
  159. package/dist/runtime/subsystems/jobs/jobs.tokens.d.ts +13 -0
  160. package/dist/runtime/subsystems/jobs/jobs.tokens.js +8 -0
  161. package/dist/runtime/subsystems/jobs/jobs.tokens.js.map +1 -0
  162. package/dist/runtime/subsystems/storage/index.d.ts +6 -0
  163. package/dist/runtime/subsystems/storage/index.js +204 -0
  164. package/dist/runtime/subsystems/storage/index.js.map +1 -0
  165. package/dist/runtime/subsystems/storage/storage.local-backend.d.ts +18 -0
  166. package/dist/runtime/subsystems/storage/storage.local-backend.js +108 -0
  167. package/dist/runtime/subsystems/storage/storage.local-backend.js.map +1 -0
  168. package/dist/runtime/subsystems/storage/storage.memory-backend.d.ts +28 -0
  169. package/dist/runtime/subsystems/storage/storage.memory-backend.js +72 -0
  170. package/dist/runtime/subsystems/storage/storage.memory-backend.js.map +1 -0
  171. package/dist/runtime/subsystems/storage/storage.module.d.ts +40 -0
  172. package/dist/runtime/subsystems/storage/storage.module.js +201 -0
  173. package/dist/runtime/subsystems/storage/storage.module.js.map +1 -0
  174. package/dist/runtime/subsystems/storage/storage.protocol.d.ts +69 -0
  175. package/dist/runtime/subsystems/storage/storage.protocol.js +1 -0
  176. package/dist/runtime/subsystems/storage/storage.protocol.js.map +1 -0
  177. package/dist/runtime/subsystems/storage/storage.tokens.d.ts +11 -0
  178. package/dist/runtime/subsystems/storage/storage.tokens.js +6 -0
  179. package/dist/runtime/subsystems/storage/storage.tokens.js.map +1 -0
  180. package/dist/runtime/subsystems/storage/storage.utils.d.ts +9 -0
  181. package/dist/runtime/subsystems/storage/storage.utils.js +18 -0
  182. package/dist/runtime/subsystems/storage/storage.utils.js.map +1 -0
  183. package/dist/runtime/types/drizzle.d.ts +17 -0
  184. package/dist/runtime/types/drizzle.js +1 -0
  185. package/dist/runtime/types/drizzle.js.map +1 -0
  186. package/dist/src/cli/index.d.ts +1 -0
  187. package/dist/src/cli/index.js +7365 -0
  188. package/dist/src/cli/index.js.map +1 -0
  189. package/dist/src/index.d.ts +2384 -0
  190. package/dist/src/index.js +2198 -0
  191. package/dist/src/index.js.map +1 -0
  192. package/package.json +114 -0
  193. package/templates/broadcast/new/backend-interface.ejs.t +47 -0
  194. package/templates/broadcast/new/bridge-listener.ejs.t +67 -0
  195. package/templates/broadcast/new/channel.ejs.t +77 -0
  196. package/templates/broadcast/new/index.ejs.t +21 -0
  197. package/templates/broadcast/new/memory-backend.ejs.t +87 -0
  198. package/templates/broadcast/new/module.ejs.t +57 -0
  199. package/templates/broadcast/new/prompt.js +268 -0
  200. package/templates/broadcast/new/websocket-backend.ejs.t +259 -0
  201. package/templates/entity/new/backend/application/commands/create.ejs.t +55 -0
  202. package/templates/entity/new/backend/application/commands/delete.ejs.t +45 -0
  203. package/templates/entity/new/backend/application/commands/grouped-index.ejs.t +149 -0
  204. package/templates/entity/new/backend/application/commands/index.ejs.t +15 -0
  205. package/templates/entity/new/backend/application/commands/update.ejs.t +58 -0
  206. package/templates/entity/new/backend/application/queries/declarative-queries.ejs.t +36 -0
  207. package/templates/entity/new/backend/application/queries/get-by-id.ejs.t +42 -0
  208. package/templates/entity/new/backend/application/queries/grouped-index.ejs.t +81 -0
  209. package/templates/entity/new/backend/application/queries/index.ejs.t +14 -0
  210. package/templates/entity/new/backend/application/queries/list.ejs.t +36 -0
  211. package/templates/entity/new/backend/application/schemas/_inject-index.ejs.t +7 -0
  212. package/templates/entity/new/backend/application/schemas/dto.ejs.t +45 -0
  213. package/templates/entity/new/backend/database/_inject-index.ejs.t +7 -0
  214. package/templates/entity/new/backend/database/electric-migration.ejs.t +21 -0
  215. package/templates/entity/new/backend/database/repository.ejs.t +450 -0
  216. package/templates/entity/new/backend/database/schema.ejs.t +248 -0
  217. package/templates/entity/new/backend/domain/_inject-index.ejs.t +12 -0
  218. package/templates/entity/new/backend/domain/entity.ejs.t +108 -0
  219. package/templates/entity/new/backend/domain/grouped-index.ejs.t +163 -0
  220. package/templates/entity/new/backend/domain/index.ejs.t +15 -0
  221. package/templates/entity/new/backend/domain/repository-interface.ejs.t +71 -0
  222. package/templates/entity/new/backend/modules/core/_ensure-anchor-tokens.ejs.t +10 -0
  223. package/templates/entity/new/backend/modules/core/_inject-token.ejs.t +7 -0
  224. package/templates/entity/new/backend/modules/core/module.ejs.t +67 -0
  225. package/templates/entity/new/backend/modules/trpc/module.ejs.t +67 -0
  226. package/templates/entity/new/backend/presentation/controller.ejs.t +201 -0
  227. package/templates/entity/new/clean-lite-ps/controller.ejs.t +37 -0
  228. package/templates/entity/new/clean-lite-ps/dto/create.ejs.t +17 -0
  229. package/templates/entity/new/clean-lite-ps/dto/output.ejs.t +25 -0
  230. package/templates/entity/new/clean-lite-ps/dto/update.ejs.t +11 -0
  231. package/templates/entity/new/clean-lite-ps/entity.ejs.t +52 -0
  232. package/templates/entity/new/clean-lite-ps/index.ejs.t +20 -0
  233. package/templates/entity/new/clean-lite-ps/module.ejs.t +43 -0
  234. package/templates/entity/new/clean-lite-ps/prompt-extension.js +617 -0
  235. package/templates/entity/new/clean-lite-ps/repository.ejs.t +62 -0
  236. package/templates/entity/new/clean-lite-ps/service.ejs.t +34 -0
  237. package/templates/entity/new/clean-lite-ps/use-cases/declarative-queries.ejs.t +34 -0
  238. package/templates/entity/new/clean-lite-ps/use-cases/find-by-id.ejs.t +16 -0
  239. package/templates/entity/new/clean-lite-ps/use-cases/list.ejs.t +16 -0
  240. package/templates/entity/new/frontend/_inject-entities-entry.ejs.t +7 -0
  241. package/templates/entity/new/frontend/_inject-entities-import.ejs.t +7 -0
  242. package/templates/entity/new/frontend/collections/_ensure-anchor-collections.ejs.t +10 -0
  243. package/templates/entity/new/frontend/collections/_inject-index.ejs.t +9 -0
  244. package/templates/entity/new/frontend/collections/_inject-schema-import.ejs.t +9 -0
  245. package/templates/entity/new/frontend/collections/collection.ejs.t +61 -0
  246. package/templates/entity/new/frontend/collections/collections-base.ejs.t +24 -0
  247. package/templates/entity/new/frontend/entity/collection.ejs.t +172 -0
  248. package/templates/entity/new/frontend/entity/combined.ejs.t +474 -0
  249. package/templates/entity/new/frontend/entity/fields.ejs.t +104 -0
  250. package/templates/entity/new/frontend/entity/hooks.ejs.t +73 -0
  251. package/templates/entity/new/frontend/entity/index.ejs.t +21 -0
  252. package/templates/entity/new/frontend/entity/mutation-hooks.ejs.t +84 -0
  253. package/templates/entity/new/frontend/entity/mutations.ejs.t +38 -0
  254. package/templates/entity/new/frontend/entity/types.ejs.t +59 -0
  255. package/templates/entity/new/frontend/generated/_inject-index-export.ejs.t +7 -0
  256. package/templates/entity/new/frontend/generated/_inject-index-import.ejs.t +7 -0
  257. package/templates/entity/new/frontend/generated/_inject-index-registry.ejs.t +7 -0
  258. package/templates/entity/new/frontend/store/_inject-collection-import.ejs.t +9 -0
  259. package/templates/entity/new/frontend/store/_inject-collections.ejs.t +9 -0
  260. package/templates/entity/new/frontend/store/_inject-entity.ejs.t +9 -0
  261. package/templates/entity/new/frontend/store/_inject-import.ejs.t +9 -0
  262. package/templates/entity/new/frontend/store/_inject-lookups.ejs.t +9 -0
  263. package/templates/entity/new/frontend/store/_inject-resolve.ejs.t +10 -0
  264. package/templates/entity/new/frontend/store/hooks.ejs.t +72 -0
  265. package/templates/entity/new/frontend/unified-entity.ejs.t +28 -0
  266. package/templates/entity/new/prompt.js +1421 -0
  267. package/templates/relationship/new/controller.ejs.t +36 -0
  268. package/templates/relationship/new/dto/create.ejs.t +41 -0
  269. package/templates/relationship/new/dto/output.ejs.t +44 -0
  270. package/templates/relationship/new/dto/update.ejs.t +10 -0
  271. package/templates/relationship/new/entity.ejs.t +98 -0
  272. package/templates/relationship/new/index.ejs.t +19 -0
  273. package/templates/relationship/new/module.ejs.t +35 -0
  274. package/templates/relationship/new/prompt.js +682 -0
  275. package/templates/relationship/new/repository.ejs.t +54 -0
  276. package/templates/relationship/new/service.ejs.t +31 -0
  277. package/templates/relationship/new/use-cases/declarative-queries.ejs.t +34 -0
  278. package/templates/relationship/new/use-cases/find-by-id.ejs.t +16 -0
  279. package/templates/relationship/new/use-cases/list.ejs.t +16 -0
@@ -0,0 +1,2384 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Domain Analyzer Types
5
+ *
6
+ * Core type definitions for the domain analysis tool.
7
+ */
8
+ type Severity = 'error' | 'warning' | 'info';
9
+ interface ParsedField {
10
+ name: string;
11
+ type: string;
12
+ required: boolean;
13
+ nullable: boolean;
14
+ unique: boolean;
15
+ index: boolean;
16
+ foreignKey?: {
17
+ table: string;
18
+ column: string;
19
+ };
20
+ choices?: string[];
21
+ constraints: {
22
+ minLength?: number;
23
+ maxLength?: number;
24
+ min?: number;
25
+ max?: number;
26
+ };
27
+ ui: {
28
+ label?: string;
29
+ type?: string;
30
+ importance?: string;
31
+ group?: string;
32
+ sortable?: boolean;
33
+ filterable?: boolean;
34
+ visible?: boolean;
35
+ };
36
+ }
37
+ interface ParsedRelationship {
38
+ name: string;
39
+ type: 'belongs_to' | 'has_many' | 'has_one';
40
+ target: string;
41
+ foreignKey: string;
42
+ inverse?: string;
43
+ through?: string;
44
+ resolved: boolean;
45
+ }
46
+ type EntityFamily = 'crm-synced' | 'activity' | 'knowledge' | 'metadata';
47
+ interface ParsedQuery {
48
+ by: string[];
49
+ unique?: boolean;
50
+ select?: string[];
51
+ order?: string;
52
+ limit?: boolean;
53
+ via?: string;
54
+ }
55
+ interface ParsedProviderSync {
56
+ remoteEntity: string;
57
+ direction: 'inbound' | 'outbound' | 'bidirectional';
58
+ cdc: boolean;
59
+ fieldMapping?: Record<string, string>;
60
+ readOnlyFields?: string[];
61
+ }
62
+ interface ParsedSync {
63
+ electric: boolean;
64
+ providers?: Record<string, ParsedProviderSync>;
65
+ }
66
+ interface ParsedEvent {
67
+ name: string;
68
+ queue: string;
69
+ body: Record<string, string>;
70
+ generateHandler: boolean;
71
+ }
72
+ interface ParsedEntity {
73
+ name: string;
74
+ plural: string;
75
+ table: string;
76
+ family?: EntityFamily;
77
+ folderStructure: 'nested' | 'flat';
78
+ fields: Map<string, ParsedField>;
79
+ relationships: Map<string, ParsedRelationship>;
80
+ behaviors: string[];
81
+ queries?: ParsedQuery[];
82
+ sync?: ParsedSync;
83
+ events?: ParsedEvent[];
84
+ sourcePath: string;
85
+ }
86
+ /**
87
+ * Direction metadata for a single relationship type.
88
+ * Resolved from the YAML types: block (simple list or object map).
89
+ */
90
+ interface ParsedTypeDirection {
91
+ name: string;
92
+ inverse?: string;
93
+ bidirectional: boolean;
94
+ directed: boolean;
95
+ }
96
+ /**
97
+ * A parsed relationship definition — a first-class junction entity
98
+ * between two core entities. Loaded from relationship YAML files.
99
+ *
100
+ * This is NOT the same as ParsedRelationship (which is an inline
101
+ * belongs_to/has_many/has_one on an entity). This represents a full
102
+ * junction table with its own fields, types, temporal/sourced flags.
103
+ */
104
+ interface ParsedRelationshipDefinition {
105
+ name: string;
106
+ table: string;
107
+ from: string;
108
+ to: string;
109
+ selfReferential: boolean;
110
+ fromColumn: string;
111
+ toColumn: string;
112
+ types: ParsedTypeDirection[];
113
+ hasTypes: boolean;
114
+ temporal: boolean;
115
+ sourced: boolean;
116
+ onDeleteFrom: 'restrict' | 'cascade' | 'set_null' | 'no_action';
117
+ onDeleteTo: 'restrict' | 'cascade' | 'set_null' | 'no_action';
118
+ uniqueOn: string[];
119
+ fields: Map<string, ParsedField>;
120
+ queries?: ParsedQuery[];
121
+ sourcePath: string;
122
+ }
123
+ interface EntityNode {
124
+ id: string;
125
+ name: string;
126
+ entity: ParsedEntity;
127
+ }
128
+ interface RelationshipEdge {
129
+ from: string;
130
+ to: string;
131
+ relationship: ParsedRelationship;
132
+ cardinality: '1:1' | '1:N' | 'N:1' | 'N:M';
133
+ bidirectional: boolean;
134
+ }
135
+ interface DomainGraph {
136
+ entities: Map<string, ParsedEntity>;
137
+ relationshipDefinitions: Map<string, ParsedRelationshipDefinition>;
138
+ edges: RelationshipEdge[];
139
+ }
140
+ interface AnalysisIssue {
141
+ severity: Severity;
142
+ type: string;
143
+ entity?: string;
144
+ field?: string;
145
+ message: string;
146
+ path?: string;
147
+ suggestion?: string;
148
+ }
149
+ interface DomainStatistics {
150
+ totalEntities: number;
151
+ totalFields: number;
152
+ totalRelationships: number;
153
+ fieldsByType: Record<string, number>;
154
+ relationshipsByType: Record<string, number>;
155
+ entitiesWithBehaviors: number;
156
+ averageFieldsPerEntity: number;
157
+ }
158
+ interface AnalysisResult {
159
+ isValid: boolean;
160
+ entities: ParsedEntity[];
161
+ relationshipDefinitions: ParsedRelationshipDefinition[];
162
+ graph: DomainGraph;
163
+ issues: AnalysisIssue[];
164
+ statistics: DomainStatistics;
165
+ }
166
+ type OutputFormat = 'console' | 'json' | 'markdown';
167
+ interface PathHop {
168
+ via: string;
169
+ relationship: string;
170
+ foreignKey: string;
171
+ }
172
+ interface TransitivePath {
173
+ source: string;
174
+ target: string;
175
+ hops: PathHop[];
176
+ suggestedName: string;
177
+ throughPath: string;
178
+ yamlSnippet: string;
179
+ }
180
+ interface TransitiveSuggestion extends Omit<AnalysisIssue, 'path'> {
181
+ type: 'transitive_suggestion';
182
+ path: TransitivePath;
183
+ }
184
+ interface ManifestField {
185
+ name: string;
186
+ type: string;
187
+ required: boolean;
188
+ nullable: boolean;
189
+ unique: boolean;
190
+ index: boolean;
191
+ foreignKey?: {
192
+ table: string;
193
+ column: string;
194
+ };
195
+ choices?: string[];
196
+ }
197
+ interface ManifestRelationship {
198
+ type: 'belongs_to' | 'has_many' | 'has_one';
199
+ target: string;
200
+ foreignKey: string;
201
+ through?: string;
202
+ inverse?: string;
203
+ }
204
+ interface ManifestEntity {
205
+ sourcePath: string;
206
+ table: string;
207
+ plural: string;
208
+ fields: Record<string, ManifestField>;
209
+ relationships: Record<string, ManifestRelationship>;
210
+ behaviors: string[];
211
+ }
212
+ interface ManifestSuggestion {
213
+ id: string;
214
+ source: string;
215
+ target: string;
216
+ throughPath: string;
217
+ suggestedName: string;
218
+ yamlSnippet: string;
219
+ status: 'pending' | 'accepted' | 'skipped';
220
+ detectedAt: string;
221
+ resolvedAt?: string;
222
+ }
223
+ interface CodegenManifest {
224
+ version: 1;
225
+ generatedAt: string;
226
+ entityFilesHash: string;
227
+ entities: Record<string, ManifestEntity>;
228
+ graph: {
229
+ edges: Array<{
230
+ from: string;
231
+ to: string;
232
+ relationship: string;
233
+ cardinality: '1:1' | '1:N' | 'N:1';
234
+ bidirectional: boolean;
235
+ }>;
236
+ orphans: string[];
237
+ cycles: string[][];
238
+ };
239
+ suggestions: {
240
+ transitive: ManifestSuggestion[];
241
+ };
242
+ statistics: {
243
+ totalEntities: number;
244
+ totalFields: number;
245
+ totalRelationships: number;
246
+ transitivePathsDetected: number;
247
+ };
248
+ }
249
+
250
+ declare const EntityDefinitionSchema: z.ZodObject<{
251
+ entity: z.ZodObject<{
252
+ name: z.ZodString;
253
+ plural: z.ZodString;
254
+ table: z.ZodString;
255
+ folder_structure: z.ZodOptional<z.ZodDefault<z.ZodEnum<["nested", "flat"]>>>;
256
+ file_grouping: z.ZodOptional<z.ZodDefault<z.ZodEnum<["separate", "grouped"]>>>;
257
+ behavior_strategy: z.ZodOptional<z.ZodEnum<["base_class", "inline"]>>;
258
+ expose: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["repository", "rest", "trpc", "electric"]>, "many">>>;
259
+ family: z.ZodOptional<z.ZodEnum<["base", "synced", "activity", "knowledge", "metadata"]>>;
260
+ }, "strict", z.ZodTypeAny, {
261
+ name: string;
262
+ plural: string;
263
+ table: string;
264
+ expose: ("repository" | "rest" | "trpc" | "electric")[];
265
+ folder_structure?: "flat" | "nested" | undefined;
266
+ file_grouping?: "separate" | "grouped" | undefined;
267
+ behavior_strategy?: "base_class" | "inline" | undefined;
268
+ family?: "base" | "synced" | "activity" | "knowledge" | "metadata" | undefined;
269
+ }, {
270
+ name: string;
271
+ plural: string;
272
+ table: string;
273
+ folder_structure?: "flat" | "nested" | undefined;
274
+ file_grouping?: "separate" | "grouped" | undefined;
275
+ behavior_strategy?: "base_class" | "inline" | undefined;
276
+ expose?: ("repository" | "rest" | "trpc" | "electric")[] | undefined;
277
+ family?: "base" | "synced" | "activity" | "knowledge" | "metadata" | undefined;
278
+ }>;
279
+ fields: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
280
+ type: z.ZodEnum<["string", "integer", "decimal", "boolean", "uuid", "date", "datetime", "json", "entity_ref", "string_array", "enum"]>;
281
+ required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
282
+ nullable: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
283
+ max_length: z.ZodOptional<z.ZodNumber>;
284
+ min_length: z.ZodOptional<z.ZodNumber>;
285
+ min: z.ZodOptional<z.ZodNumber>;
286
+ max: z.ZodOptional<z.ZodNumber>;
287
+ choices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
288
+ choices_from: z.ZodOptional<z.ZodString>;
289
+ allowed_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
290
+ default: z.ZodOptional<z.ZodUnknown>;
291
+ index: z.ZodOptional<z.ZodBoolean>;
292
+ unique: z.ZodOptional<z.ZodBoolean>;
293
+ foreign_key: z.ZodOptional<z.ZodString>;
294
+ } & {
295
+ ui_label: z.ZodOptional<z.ZodString>;
296
+ ui_type: z.ZodOptional<z.ZodEnum<["text", "textarea", "number", "money", "percentage", "email", "url", "date", "datetime", "boolean", "enum", "reference", "json", "badge", "password"]>>;
297
+ ui_importance: z.ZodOptional<z.ZodEnum<["primary", "secondary", "tertiary"]>>;
298
+ ui_group: z.ZodOptional<z.ZodString>;
299
+ ui_sortable: z.ZodOptional<z.ZodBoolean>;
300
+ ui_filterable: z.ZodOptional<z.ZodBoolean>;
301
+ ui_visible: z.ZodOptional<z.ZodBoolean>;
302
+ ui_placeholder: z.ZodOptional<z.ZodString>;
303
+ ui_help: z.ZodOptional<z.ZodString>;
304
+ ui_format: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
305
+ } & {
306
+ measure: z.ZodOptional<z.ZodBoolean>;
307
+ analytics_aggregation: z.ZodOptional<z.ZodEnum<["sum", "min", "max", "count", "count_distinct", "average", "median", "percentile", "sum_boolean"]>>;
308
+ agg_time_dimension: z.ZodOptional<z.ZodString>;
309
+ non_additive_dimension: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
310
+ name: z.ZodString;
311
+ window_choice: z.ZodOptional<z.ZodString>;
312
+ window_groupings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
313
+ }, "strip", z.ZodTypeAny, {
314
+ name: string;
315
+ window_choice?: string | undefined;
316
+ window_groupings?: string[] | undefined;
317
+ }, {
318
+ name: string;
319
+ window_choice?: string | undefined;
320
+ window_groupings?: string[] | undefined;
321
+ }>]>>;
322
+ dimension: z.ZodOptional<z.ZodBoolean>;
323
+ dimension_type: z.ZodOptional<z.ZodEnum<["categorical", "time"]>>;
324
+ time_granularity: z.ZodOptional<z.ZodEnum<["day", "week", "month", "quarter", "year"]>>;
325
+ is_partition: z.ZodOptional<z.ZodBoolean>;
326
+ entity: z.ZodOptional<z.ZodBoolean>;
327
+ entity_type: z.ZodOptional<z.ZodEnum<["primary", "unique", "foreign", "natural"]>>;
328
+ entity_role: z.ZodOptional<z.ZodString>;
329
+ analytics_visibility: z.ZodOptional<z.ZodEnum<["internal", "agent", "public"]>>;
330
+ semantic_expr: z.ZodOptional<z.ZodString>;
331
+ semantic_label: z.ZodOptional<z.ZodString>;
332
+ }, "strip", z.ZodTypeAny, {
333
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
334
+ required: boolean;
335
+ nullable: boolean;
336
+ min?: number | undefined;
337
+ max?: number | undefined;
338
+ unique?: boolean | undefined;
339
+ measure?: boolean | undefined;
340
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
341
+ agg_time_dimension?: string | undefined;
342
+ non_additive_dimension?: string | {
343
+ name: string;
344
+ window_choice?: string | undefined;
345
+ window_groupings?: string[] | undefined;
346
+ } | undefined;
347
+ dimension?: boolean | undefined;
348
+ dimension_type?: "categorical" | "time" | undefined;
349
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
350
+ is_partition?: boolean | undefined;
351
+ entity?: boolean | undefined;
352
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
353
+ entity_role?: string | undefined;
354
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
355
+ semantic_expr?: string | undefined;
356
+ semantic_label?: string | undefined;
357
+ ui_label?: string | undefined;
358
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
359
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
360
+ ui_group?: string | undefined;
361
+ ui_sortable?: boolean | undefined;
362
+ ui_filterable?: boolean | undefined;
363
+ ui_visible?: boolean | undefined;
364
+ ui_placeholder?: string | undefined;
365
+ ui_help?: string | undefined;
366
+ ui_format?: Record<string, unknown> | undefined;
367
+ max_length?: number | undefined;
368
+ min_length?: number | undefined;
369
+ choices?: string[] | undefined;
370
+ choices_from?: string | undefined;
371
+ allowed_types?: string[] | undefined;
372
+ default?: unknown;
373
+ index?: boolean | undefined;
374
+ foreign_key?: string | undefined;
375
+ }, {
376
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
377
+ min?: number | undefined;
378
+ max?: number | undefined;
379
+ unique?: boolean | undefined;
380
+ measure?: boolean | undefined;
381
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
382
+ agg_time_dimension?: string | undefined;
383
+ non_additive_dimension?: string | {
384
+ name: string;
385
+ window_choice?: string | undefined;
386
+ window_groupings?: string[] | undefined;
387
+ } | undefined;
388
+ dimension?: boolean | undefined;
389
+ dimension_type?: "categorical" | "time" | undefined;
390
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
391
+ is_partition?: boolean | undefined;
392
+ entity?: boolean | undefined;
393
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
394
+ entity_role?: string | undefined;
395
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
396
+ semantic_expr?: string | undefined;
397
+ semantic_label?: string | undefined;
398
+ ui_label?: string | undefined;
399
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
400
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
401
+ ui_group?: string | undefined;
402
+ ui_sortable?: boolean | undefined;
403
+ ui_filterable?: boolean | undefined;
404
+ ui_visible?: boolean | undefined;
405
+ ui_placeholder?: string | undefined;
406
+ ui_help?: string | undefined;
407
+ ui_format?: Record<string, unknown> | undefined;
408
+ required?: boolean | undefined;
409
+ nullable?: boolean | undefined;
410
+ max_length?: number | undefined;
411
+ min_length?: number | undefined;
412
+ choices?: string[] | undefined;
413
+ choices_from?: string | undefined;
414
+ allowed_types?: string[] | undefined;
415
+ default?: unknown;
416
+ index?: boolean | undefined;
417
+ foreign_key?: string | undefined;
418
+ }>, {
419
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
420
+ required: boolean;
421
+ nullable: boolean;
422
+ min?: number | undefined;
423
+ max?: number | undefined;
424
+ unique?: boolean | undefined;
425
+ measure?: boolean | undefined;
426
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
427
+ agg_time_dimension?: string | undefined;
428
+ non_additive_dimension?: string | {
429
+ name: string;
430
+ window_choice?: string | undefined;
431
+ window_groupings?: string[] | undefined;
432
+ } | undefined;
433
+ dimension?: boolean | undefined;
434
+ dimension_type?: "categorical" | "time" | undefined;
435
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
436
+ is_partition?: boolean | undefined;
437
+ entity?: boolean | undefined;
438
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
439
+ entity_role?: string | undefined;
440
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
441
+ semantic_expr?: string | undefined;
442
+ semantic_label?: string | undefined;
443
+ ui_label?: string | undefined;
444
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
445
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
446
+ ui_group?: string | undefined;
447
+ ui_sortable?: boolean | undefined;
448
+ ui_filterable?: boolean | undefined;
449
+ ui_visible?: boolean | undefined;
450
+ ui_placeholder?: string | undefined;
451
+ ui_help?: string | undefined;
452
+ ui_format?: Record<string, unknown> | undefined;
453
+ max_length?: number | undefined;
454
+ min_length?: number | undefined;
455
+ choices?: string[] | undefined;
456
+ choices_from?: string | undefined;
457
+ allowed_types?: string[] | undefined;
458
+ default?: unknown;
459
+ index?: boolean | undefined;
460
+ foreign_key?: string | undefined;
461
+ }, {
462
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
463
+ min?: number | undefined;
464
+ max?: number | undefined;
465
+ unique?: boolean | undefined;
466
+ measure?: boolean | undefined;
467
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
468
+ agg_time_dimension?: string | undefined;
469
+ non_additive_dimension?: string | {
470
+ name: string;
471
+ window_choice?: string | undefined;
472
+ window_groupings?: string[] | undefined;
473
+ } | undefined;
474
+ dimension?: boolean | undefined;
475
+ dimension_type?: "categorical" | "time" | undefined;
476
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
477
+ is_partition?: boolean | undefined;
478
+ entity?: boolean | undefined;
479
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
480
+ entity_role?: string | undefined;
481
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
482
+ semantic_expr?: string | undefined;
483
+ semantic_label?: string | undefined;
484
+ ui_label?: string | undefined;
485
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
486
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
487
+ ui_group?: string | undefined;
488
+ ui_sortable?: boolean | undefined;
489
+ ui_filterable?: boolean | undefined;
490
+ ui_visible?: boolean | undefined;
491
+ ui_placeholder?: string | undefined;
492
+ ui_help?: string | undefined;
493
+ ui_format?: Record<string, unknown> | undefined;
494
+ required?: boolean | undefined;
495
+ nullable?: boolean | undefined;
496
+ max_length?: number | undefined;
497
+ min_length?: number | undefined;
498
+ choices?: string[] | undefined;
499
+ choices_from?: string | undefined;
500
+ allowed_types?: string[] | undefined;
501
+ default?: unknown;
502
+ index?: boolean | undefined;
503
+ foreign_key?: string | undefined;
504
+ }>, {
505
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
506
+ required: boolean;
507
+ nullable: boolean;
508
+ min?: number | undefined;
509
+ max?: number | undefined;
510
+ unique?: boolean | undefined;
511
+ measure?: boolean | undefined;
512
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
513
+ agg_time_dimension?: string | undefined;
514
+ non_additive_dimension?: string | {
515
+ name: string;
516
+ window_choice?: string | undefined;
517
+ window_groupings?: string[] | undefined;
518
+ } | undefined;
519
+ dimension?: boolean | undefined;
520
+ dimension_type?: "categorical" | "time" | undefined;
521
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
522
+ is_partition?: boolean | undefined;
523
+ entity?: boolean | undefined;
524
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
525
+ entity_role?: string | undefined;
526
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
527
+ semantic_expr?: string | undefined;
528
+ semantic_label?: string | undefined;
529
+ ui_label?: string | undefined;
530
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
531
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
532
+ ui_group?: string | undefined;
533
+ ui_sortable?: boolean | undefined;
534
+ ui_filterable?: boolean | undefined;
535
+ ui_visible?: boolean | undefined;
536
+ ui_placeholder?: string | undefined;
537
+ ui_help?: string | undefined;
538
+ ui_format?: Record<string, unknown> | undefined;
539
+ max_length?: number | undefined;
540
+ min_length?: number | undefined;
541
+ choices?: string[] | undefined;
542
+ choices_from?: string | undefined;
543
+ allowed_types?: string[] | undefined;
544
+ default?: unknown;
545
+ index?: boolean | undefined;
546
+ foreign_key?: string | undefined;
547
+ }, {
548
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
549
+ min?: number | undefined;
550
+ max?: number | undefined;
551
+ unique?: boolean | undefined;
552
+ measure?: boolean | undefined;
553
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
554
+ agg_time_dimension?: string | undefined;
555
+ non_additive_dimension?: string | {
556
+ name: string;
557
+ window_choice?: string | undefined;
558
+ window_groupings?: string[] | undefined;
559
+ } | undefined;
560
+ dimension?: boolean | undefined;
561
+ dimension_type?: "categorical" | "time" | undefined;
562
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
563
+ is_partition?: boolean | undefined;
564
+ entity?: boolean | undefined;
565
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
566
+ entity_role?: string | undefined;
567
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
568
+ semantic_expr?: string | undefined;
569
+ semantic_label?: string | undefined;
570
+ ui_label?: string | undefined;
571
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
572
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
573
+ ui_group?: string | undefined;
574
+ ui_sortable?: boolean | undefined;
575
+ ui_filterable?: boolean | undefined;
576
+ ui_visible?: boolean | undefined;
577
+ ui_placeholder?: string | undefined;
578
+ ui_help?: string | undefined;
579
+ ui_format?: Record<string, unknown> | undefined;
580
+ required?: boolean | undefined;
581
+ nullable?: boolean | undefined;
582
+ max_length?: number | undefined;
583
+ min_length?: number | undefined;
584
+ choices?: string[] | undefined;
585
+ choices_from?: string | undefined;
586
+ allowed_types?: string[] | undefined;
587
+ default?: unknown;
588
+ index?: boolean | undefined;
589
+ foreign_key?: string | undefined;
590
+ }>, {
591
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
592
+ required: boolean;
593
+ nullable: boolean;
594
+ min?: number | undefined;
595
+ max?: number | undefined;
596
+ unique?: boolean | undefined;
597
+ measure?: boolean | undefined;
598
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
599
+ agg_time_dimension?: string | undefined;
600
+ non_additive_dimension?: string | {
601
+ name: string;
602
+ window_choice?: string | undefined;
603
+ window_groupings?: string[] | undefined;
604
+ } | undefined;
605
+ dimension?: boolean | undefined;
606
+ dimension_type?: "categorical" | "time" | undefined;
607
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
608
+ is_partition?: boolean | undefined;
609
+ entity?: boolean | undefined;
610
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
611
+ entity_role?: string | undefined;
612
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
613
+ semantic_expr?: string | undefined;
614
+ semantic_label?: string | undefined;
615
+ ui_label?: string | undefined;
616
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
617
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
618
+ ui_group?: string | undefined;
619
+ ui_sortable?: boolean | undefined;
620
+ ui_filterable?: boolean | undefined;
621
+ ui_visible?: boolean | undefined;
622
+ ui_placeholder?: string | undefined;
623
+ ui_help?: string | undefined;
624
+ ui_format?: Record<string, unknown> | undefined;
625
+ max_length?: number | undefined;
626
+ min_length?: number | undefined;
627
+ choices?: string[] | undefined;
628
+ choices_from?: string | undefined;
629
+ allowed_types?: string[] | undefined;
630
+ default?: unknown;
631
+ index?: boolean | undefined;
632
+ foreign_key?: string | undefined;
633
+ }, {
634
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
635
+ min?: number | undefined;
636
+ max?: number | undefined;
637
+ unique?: boolean | undefined;
638
+ measure?: boolean | undefined;
639
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
640
+ agg_time_dimension?: string | undefined;
641
+ non_additive_dimension?: string | {
642
+ name: string;
643
+ window_choice?: string | undefined;
644
+ window_groupings?: string[] | undefined;
645
+ } | undefined;
646
+ dimension?: boolean | undefined;
647
+ dimension_type?: "categorical" | "time" | undefined;
648
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
649
+ is_partition?: boolean | undefined;
650
+ entity?: boolean | undefined;
651
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
652
+ entity_role?: string | undefined;
653
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
654
+ semantic_expr?: string | undefined;
655
+ semantic_label?: string | undefined;
656
+ ui_label?: string | undefined;
657
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
658
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
659
+ ui_group?: string | undefined;
660
+ ui_sortable?: boolean | undefined;
661
+ ui_filterable?: boolean | undefined;
662
+ ui_visible?: boolean | undefined;
663
+ ui_placeholder?: string | undefined;
664
+ ui_help?: string | undefined;
665
+ ui_format?: Record<string, unknown> | undefined;
666
+ required?: boolean | undefined;
667
+ nullable?: boolean | undefined;
668
+ max_length?: number | undefined;
669
+ min_length?: number | undefined;
670
+ choices?: string[] | undefined;
671
+ choices_from?: string | undefined;
672
+ allowed_types?: string[] | undefined;
673
+ default?: unknown;
674
+ index?: boolean | undefined;
675
+ foreign_key?: string | undefined;
676
+ }>, {
677
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
678
+ required: boolean;
679
+ nullable: boolean;
680
+ min?: number | undefined;
681
+ max?: number | undefined;
682
+ unique?: boolean | undefined;
683
+ measure?: boolean | undefined;
684
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
685
+ agg_time_dimension?: string | undefined;
686
+ non_additive_dimension?: string | {
687
+ name: string;
688
+ window_choice?: string | undefined;
689
+ window_groupings?: string[] | undefined;
690
+ } | undefined;
691
+ dimension?: boolean | undefined;
692
+ dimension_type?: "categorical" | "time" | undefined;
693
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
694
+ is_partition?: boolean | undefined;
695
+ entity?: boolean | undefined;
696
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
697
+ entity_role?: string | undefined;
698
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
699
+ semantic_expr?: string | undefined;
700
+ semantic_label?: string | undefined;
701
+ ui_label?: string | undefined;
702
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
703
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
704
+ ui_group?: string | undefined;
705
+ ui_sortable?: boolean | undefined;
706
+ ui_filterable?: boolean | undefined;
707
+ ui_visible?: boolean | undefined;
708
+ ui_placeholder?: string | undefined;
709
+ ui_help?: string | undefined;
710
+ ui_format?: Record<string, unknown> | undefined;
711
+ max_length?: number | undefined;
712
+ min_length?: number | undefined;
713
+ choices?: string[] | undefined;
714
+ choices_from?: string | undefined;
715
+ allowed_types?: string[] | undefined;
716
+ default?: unknown;
717
+ index?: boolean | undefined;
718
+ foreign_key?: string | undefined;
719
+ }, {
720
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
721
+ min?: number | undefined;
722
+ max?: number | undefined;
723
+ unique?: boolean | undefined;
724
+ measure?: boolean | undefined;
725
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
726
+ agg_time_dimension?: string | undefined;
727
+ non_additive_dimension?: string | {
728
+ name: string;
729
+ window_choice?: string | undefined;
730
+ window_groupings?: string[] | undefined;
731
+ } | undefined;
732
+ dimension?: boolean | undefined;
733
+ dimension_type?: "categorical" | "time" | undefined;
734
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
735
+ is_partition?: boolean | undefined;
736
+ entity?: boolean | undefined;
737
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
738
+ entity_role?: string | undefined;
739
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
740
+ semantic_expr?: string | undefined;
741
+ semantic_label?: string | undefined;
742
+ ui_label?: string | undefined;
743
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
744
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
745
+ ui_group?: string | undefined;
746
+ ui_sortable?: boolean | undefined;
747
+ ui_filterable?: boolean | undefined;
748
+ ui_visible?: boolean | undefined;
749
+ ui_placeholder?: string | undefined;
750
+ ui_help?: string | undefined;
751
+ ui_format?: Record<string, unknown> | undefined;
752
+ required?: boolean | undefined;
753
+ nullable?: boolean | undefined;
754
+ max_length?: number | undefined;
755
+ min_length?: number | undefined;
756
+ choices?: string[] | undefined;
757
+ choices_from?: string | undefined;
758
+ allowed_types?: string[] | undefined;
759
+ default?: unknown;
760
+ index?: boolean | undefined;
761
+ foreign_key?: string | undefined;
762
+ }>, {
763
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
764
+ required: boolean;
765
+ nullable: boolean;
766
+ min?: number | undefined;
767
+ max?: number | undefined;
768
+ unique?: boolean | undefined;
769
+ measure?: boolean | undefined;
770
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
771
+ agg_time_dimension?: string | undefined;
772
+ non_additive_dimension?: string | {
773
+ name: string;
774
+ window_choice?: string | undefined;
775
+ window_groupings?: string[] | undefined;
776
+ } | undefined;
777
+ dimension?: boolean | undefined;
778
+ dimension_type?: "categorical" | "time" | undefined;
779
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
780
+ is_partition?: boolean | undefined;
781
+ entity?: boolean | undefined;
782
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
783
+ entity_role?: string | undefined;
784
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
785
+ semantic_expr?: string | undefined;
786
+ semantic_label?: string | undefined;
787
+ ui_label?: string | undefined;
788
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
789
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
790
+ ui_group?: string | undefined;
791
+ ui_sortable?: boolean | undefined;
792
+ ui_filterable?: boolean | undefined;
793
+ ui_visible?: boolean | undefined;
794
+ ui_placeholder?: string | undefined;
795
+ ui_help?: string | undefined;
796
+ ui_format?: Record<string, unknown> | undefined;
797
+ max_length?: number | undefined;
798
+ min_length?: number | undefined;
799
+ choices?: string[] | undefined;
800
+ choices_from?: string | undefined;
801
+ allowed_types?: string[] | undefined;
802
+ default?: unknown;
803
+ index?: boolean | undefined;
804
+ foreign_key?: string | undefined;
805
+ }, {
806
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
807
+ min?: number | undefined;
808
+ max?: number | undefined;
809
+ unique?: boolean | undefined;
810
+ measure?: boolean | undefined;
811
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
812
+ agg_time_dimension?: string | undefined;
813
+ non_additive_dimension?: string | {
814
+ name: string;
815
+ window_choice?: string | undefined;
816
+ window_groupings?: string[] | undefined;
817
+ } | undefined;
818
+ dimension?: boolean | undefined;
819
+ dimension_type?: "categorical" | "time" | undefined;
820
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
821
+ is_partition?: boolean | undefined;
822
+ entity?: boolean | undefined;
823
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
824
+ entity_role?: string | undefined;
825
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
826
+ semantic_expr?: string | undefined;
827
+ semantic_label?: string | undefined;
828
+ ui_label?: string | undefined;
829
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
830
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
831
+ ui_group?: string | undefined;
832
+ ui_sortable?: boolean | undefined;
833
+ ui_filterable?: boolean | undefined;
834
+ ui_visible?: boolean | undefined;
835
+ ui_placeholder?: string | undefined;
836
+ ui_help?: string | undefined;
837
+ ui_format?: Record<string, unknown> | undefined;
838
+ required?: boolean | undefined;
839
+ nullable?: boolean | undefined;
840
+ max_length?: number | undefined;
841
+ min_length?: number | undefined;
842
+ choices?: string[] | undefined;
843
+ choices_from?: string | undefined;
844
+ allowed_types?: string[] | undefined;
845
+ default?: unknown;
846
+ index?: boolean | undefined;
847
+ foreign_key?: string | undefined;
848
+ }>, {
849
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
850
+ required: boolean;
851
+ nullable: boolean;
852
+ min?: number | undefined;
853
+ max?: number | undefined;
854
+ unique?: boolean | undefined;
855
+ measure?: boolean | undefined;
856
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
857
+ agg_time_dimension?: string | undefined;
858
+ non_additive_dimension?: string | {
859
+ name: string;
860
+ window_choice?: string | undefined;
861
+ window_groupings?: string[] | undefined;
862
+ } | undefined;
863
+ dimension?: boolean | undefined;
864
+ dimension_type?: "categorical" | "time" | undefined;
865
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
866
+ is_partition?: boolean | undefined;
867
+ entity?: boolean | undefined;
868
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
869
+ entity_role?: string | undefined;
870
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
871
+ semantic_expr?: string | undefined;
872
+ semantic_label?: string | undefined;
873
+ ui_label?: string | undefined;
874
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
875
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
876
+ ui_group?: string | undefined;
877
+ ui_sortable?: boolean | undefined;
878
+ ui_filterable?: boolean | undefined;
879
+ ui_visible?: boolean | undefined;
880
+ ui_placeholder?: string | undefined;
881
+ ui_help?: string | undefined;
882
+ ui_format?: Record<string, unknown> | undefined;
883
+ max_length?: number | undefined;
884
+ min_length?: number | undefined;
885
+ choices?: string[] | undefined;
886
+ choices_from?: string | undefined;
887
+ allowed_types?: string[] | undefined;
888
+ default?: unknown;
889
+ index?: boolean | undefined;
890
+ foreign_key?: string | undefined;
891
+ }, {
892
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
893
+ min?: number | undefined;
894
+ max?: number | undefined;
895
+ unique?: boolean | undefined;
896
+ measure?: boolean | undefined;
897
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
898
+ agg_time_dimension?: string | undefined;
899
+ non_additive_dimension?: string | {
900
+ name: string;
901
+ window_choice?: string | undefined;
902
+ window_groupings?: string[] | undefined;
903
+ } | undefined;
904
+ dimension?: boolean | undefined;
905
+ dimension_type?: "categorical" | "time" | undefined;
906
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
907
+ is_partition?: boolean | undefined;
908
+ entity?: boolean | undefined;
909
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
910
+ entity_role?: string | undefined;
911
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
912
+ semantic_expr?: string | undefined;
913
+ semantic_label?: string | undefined;
914
+ ui_label?: string | undefined;
915
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
916
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
917
+ ui_group?: string | undefined;
918
+ ui_sortable?: boolean | undefined;
919
+ ui_filterable?: boolean | undefined;
920
+ ui_visible?: boolean | undefined;
921
+ ui_placeholder?: string | undefined;
922
+ ui_help?: string | undefined;
923
+ ui_format?: Record<string, unknown> | undefined;
924
+ required?: boolean | undefined;
925
+ nullable?: boolean | undefined;
926
+ max_length?: number | undefined;
927
+ min_length?: number | undefined;
928
+ choices?: string[] | undefined;
929
+ choices_from?: string | undefined;
930
+ allowed_types?: string[] | undefined;
931
+ default?: unknown;
932
+ index?: boolean | undefined;
933
+ foreign_key?: string | undefined;
934
+ }>, {
935
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
936
+ required: boolean;
937
+ nullable: boolean;
938
+ min?: number | undefined;
939
+ max?: number | undefined;
940
+ unique?: boolean | undefined;
941
+ measure?: boolean | undefined;
942
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
943
+ agg_time_dimension?: string | undefined;
944
+ non_additive_dimension?: string | {
945
+ name: string;
946
+ window_choice?: string | undefined;
947
+ window_groupings?: string[] | undefined;
948
+ } | undefined;
949
+ dimension?: boolean | undefined;
950
+ dimension_type?: "categorical" | "time" | undefined;
951
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
952
+ is_partition?: boolean | undefined;
953
+ entity?: boolean | undefined;
954
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
955
+ entity_role?: string | undefined;
956
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
957
+ semantic_expr?: string | undefined;
958
+ semantic_label?: string | undefined;
959
+ ui_label?: string | undefined;
960
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
961
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
962
+ ui_group?: string | undefined;
963
+ ui_sortable?: boolean | undefined;
964
+ ui_filterable?: boolean | undefined;
965
+ ui_visible?: boolean | undefined;
966
+ ui_placeholder?: string | undefined;
967
+ ui_help?: string | undefined;
968
+ ui_format?: Record<string, unknown> | undefined;
969
+ max_length?: number | undefined;
970
+ min_length?: number | undefined;
971
+ choices?: string[] | undefined;
972
+ choices_from?: string | undefined;
973
+ allowed_types?: string[] | undefined;
974
+ default?: unknown;
975
+ index?: boolean | undefined;
976
+ foreign_key?: string | undefined;
977
+ }, {
978
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
979
+ min?: number | undefined;
980
+ max?: number | undefined;
981
+ unique?: boolean | undefined;
982
+ measure?: boolean | undefined;
983
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
984
+ agg_time_dimension?: string | undefined;
985
+ non_additive_dimension?: string | {
986
+ name: string;
987
+ window_choice?: string | undefined;
988
+ window_groupings?: string[] | undefined;
989
+ } | undefined;
990
+ dimension?: boolean | undefined;
991
+ dimension_type?: "categorical" | "time" | undefined;
992
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
993
+ is_partition?: boolean | undefined;
994
+ entity?: boolean | undefined;
995
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
996
+ entity_role?: string | undefined;
997
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
998
+ semantic_expr?: string | undefined;
999
+ semantic_label?: string | undefined;
1000
+ ui_label?: string | undefined;
1001
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1002
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1003
+ ui_group?: string | undefined;
1004
+ ui_sortable?: boolean | undefined;
1005
+ ui_filterable?: boolean | undefined;
1006
+ ui_visible?: boolean | undefined;
1007
+ ui_placeholder?: string | undefined;
1008
+ ui_help?: string | undefined;
1009
+ ui_format?: Record<string, unknown> | undefined;
1010
+ required?: boolean | undefined;
1011
+ nullable?: boolean | undefined;
1012
+ max_length?: number | undefined;
1013
+ min_length?: number | undefined;
1014
+ choices?: string[] | undefined;
1015
+ choices_from?: string | undefined;
1016
+ allowed_types?: string[] | undefined;
1017
+ default?: unknown;
1018
+ index?: boolean | undefined;
1019
+ foreign_key?: string | undefined;
1020
+ }>, {
1021
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1022
+ required: boolean;
1023
+ nullable: boolean;
1024
+ min?: number | undefined;
1025
+ max?: number | undefined;
1026
+ unique?: boolean | undefined;
1027
+ measure?: boolean | undefined;
1028
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1029
+ agg_time_dimension?: string | undefined;
1030
+ non_additive_dimension?: string | {
1031
+ name: string;
1032
+ window_choice?: string | undefined;
1033
+ window_groupings?: string[] | undefined;
1034
+ } | undefined;
1035
+ dimension?: boolean | undefined;
1036
+ dimension_type?: "categorical" | "time" | undefined;
1037
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1038
+ is_partition?: boolean | undefined;
1039
+ entity?: boolean | undefined;
1040
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1041
+ entity_role?: string | undefined;
1042
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1043
+ semantic_expr?: string | undefined;
1044
+ semantic_label?: string | undefined;
1045
+ ui_label?: string | undefined;
1046
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1047
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1048
+ ui_group?: string | undefined;
1049
+ ui_sortable?: boolean | undefined;
1050
+ ui_filterable?: boolean | undefined;
1051
+ ui_visible?: boolean | undefined;
1052
+ ui_placeholder?: string | undefined;
1053
+ ui_help?: string | undefined;
1054
+ ui_format?: Record<string, unknown> | undefined;
1055
+ max_length?: number | undefined;
1056
+ min_length?: number | undefined;
1057
+ choices?: string[] | undefined;
1058
+ choices_from?: string | undefined;
1059
+ allowed_types?: string[] | undefined;
1060
+ default?: unknown;
1061
+ index?: boolean | undefined;
1062
+ foreign_key?: string | undefined;
1063
+ }, {
1064
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1065
+ min?: number | undefined;
1066
+ max?: number | undefined;
1067
+ unique?: boolean | undefined;
1068
+ measure?: boolean | undefined;
1069
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1070
+ agg_time_dimension?: string | undefined;
1071
+ non_additive_dimension?: string | {
1072
+ name: string;
1073
+ window_choice?: string | undefined;
1074
+ window_groupings?: string[] | undefined;
1075
+ } | undefined;
1076
+ dimension?: boolean | undefined;
1077
+ dimension_type?: "categorical" | "time" | undefined;
1078
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1079
+ is_partition?: boolean | undefined;
1080
+ entity?: boolean | undefined;
1081
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1082
+ entity_role?: string | undefined;
1083
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1084
+ semantic_expr?: string | undefined;
1085
+ semantic_label?: string | undefined;
1086
+ ui_label?: string | undefined;
1087
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1088
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1089
+ ui_group?: string | undefined;
1090
+ ui_sortable?: boolean | undefined;
1091
+ ui_filterable?: boolean | undefined;
1092
+ ui_visible?: boolean | undefined;
1093
+ ui_placeholder?: string | undefined;
1094
+ ui_help?: string | undefined;
1095
+ ui_format?: Record<string, unknown> | undefined;
1096
+ required?: boolean | undefined;
1097
+ nullable?: boolean | undefined;
1098
+ max_length?: number | undefined;
1099
+ min_length?: number | undefined;
1100
+ choices?: string[] | undefined;
1101
+ choices_from?: string | undefined;
1102
+ allowed_types?: string[] | undefined;
1103
+ default?: unknown;
1104
+ index?: boolean | undefined;
1105
+ foreign_key?: string | undefined;
1106
+ }>, {
1107
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1108
+ required: boolean;
1109
+ nullable: boolean;
1110
+ min?: number | undefined;
1111
+ max?: number | undefined;
1112
+ unique?: boolean | undefined;
1113
+ measure?: boolean | undefined;
1114
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1115
+ agg_time_dimension?: string | undefined;
1116
+ non_additive_dimension?: string | {
1117
+ name: string;
1118
+ window_choice?: string | undefined;
1119
+ window_groupings?: string[] | undefined;
1120
+ } | undefined;
1121
+ dimension?: boolean | undefined;
1122
+ dimension_type?: "categorical" | "time" | undefined;
1123
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1124
+ is_partition?: boolean | undefined;
1125
+ entity?: boolean | undefined;
1126
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1127
+ entity_role?: string | undefined;
1128
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1129
+ semantic_expr?: string | undefined;
1130
+ semantic_label?: string | undefined;
1131
+ ui_label?: string | undefined;
1132
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1133
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1134
+ ui_group?: string | undefined;
1135
+ ui_sortable?: boolean | undefined;
1136
+ ui_filterable?: boolean | undefined;
1137
+ ui_visible?: boolean | undefined;
1138
+ ui_placeholder?: string | undefined;
1139
+ ui_help?: string | undefined;
1140
+ ui_format?: Record<string, unknown> | undefined;
1141
+ max_length?: number | undefined;
1142
+ min_length?: number | undefined;
1143
+ choices?: string[] | undefined;
1144
+ choices_from?: string | undefined;
1145
+ allowed_types?: string[] | undefined;
1146
+ default?: unknown;
1147
+ index?: boolean | undefined;
1148
+ foreign_key?: string | undefined;
1149
+ }, {
1150
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1151
+ min?: number | undefined;
1152
+ max?: number | undefined;
1153
+ unique?: boolean | undefined;
1154
+ measure?: boolean | undefined;
1155
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1156
+ agg_time_dimension?: string | undefined;
1157
+ non_additive_dimension?: string | {
1158
+ name: string;
1159
+ window_choice?: string | undefined;
1160
+ window_groupings?: string[] | undefined;
1161
+ } | undefined;
1162
+ dimension?: boolean | undefined;
1163
+ dimension_type?: "categorical" | "time" | undefined;
1164
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1165
+ is_partition?: boolean | undefined;
1166
+ entity?: boolean | undefined;
1167
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1168
+ entity_role?: string | undefined;
1169
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1170
+ semantic_expr?: string | undefined;
1171
+ semantic_label?: string | undefined;
1172
+ ui_label?: string | undefined;
1173
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1174
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1175
+ ui_group?: string | undefined;
1176
+ ui_sortable?: boolean | undefined;
1177
+ ui_filterable?: boolean | undefined;
1178
+ ui_visible?: boolean | undefined;
1179
+ ui_placeholder?: string | undefined;
1180
+ ui_help?: string | undefined;
1181
+ ui_format?: Record<string, unknown> | undefined;
1182
+ required?: boolean | undefined;
1183
+ nullable?: boolean | undefined;
1184
+ max_length?: number | undefined;
1185
+ min_length?: number | undefined;
1186
+ choices?: string[] | undefined;
1187
+ choices_from?: string | undefined;
1188
+ allowed_types?: string[] | undefined;
1189
+ default?: unknown;
1190
+ index?: boolean | undefined;
1191
+ foreign_key?: string | undefined;
1192
+ }>, {
1193
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1194
+ required: boolean;
1195
+ nullable: boolean;
1196
+ min?: number | undefined;
1197
+ max?: number | undefined;
1198
+ unique?: boolean | undefined;
1199
+ measure?: boolean | undefined;
1200
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1201
+ agg_time_dimension?: string | undefined;
1202
+ non_additive_dimension?: string | {
1203
+ name: string;
1204
+ window_choice?: string | undefined;
1205
+ window_groupings?: string[] | undefined;
1206
+ } | undefined;
1207
+ dimension?: boolean | undefined;
1208
+ dimension_type?: "categorical" | "time" | undefined;
1209
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1210
+ is_partition?: boolean | undefined;
1211
+ entity?: boolean | undefined;
1212
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1213
+ entity_role?: string | undefined;
1214
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1215
+ semantic_expr?: string | undefined;
1216
+ semantic_label?: string | undefined;
1217
+ ui_label?: string | undefined;
1218
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1219
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1220
+ ui_group?: string | undefined;
1221
+ ui_sortable?: boolean | undefined;
1222
+ ui_filterable?: boolean | undefined;
1223
+ ui_visible?: boolean | undefined;
1224
+ ui_placeholder?: string | undefined;
1225
+ ui_help?: string | undefined;
1226
+ ui_format?: Record<string, unknown> | undefined;
1227
+ max_length?: number | undefined;
1228
+ min_length?: number | undefined;
1229
+ choices?: string[] | undefined;
1230
+ choices_from?: string | undefined;
1231
+ allowed_types?: string[] | undefined;
1232
+ default?: unknown;
1233
+ index?: boolean | undefined;
1234
+ foreign_key?: string | undefined;
1235
+ }, {
1236
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1237
+ min?: number | undefined;
1238
+ max?: number | undefined;
1239
+ unique?: boolean | undefined;
1240
+ measure?: boolean | undefined;
1241
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1242
+ agg_time_dimension?: string | undefined;
1243
+ non_additive_dimension?: string | {
1244
+ name: string;
1245
+ window_choice?: string | undefined;
1246
+ window_groupings?: string[] | undefined;
1247
+ } | undefined;
1248
+ dimension?: boolean | undefined;
1249
+ dimension_type?: "categorical" | "time" | undefined;
1250
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1251
+ is_partition?: boolean | undefined;
1252
+ entity?: boolean | undefined;
1253
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1254
+ entity_role?: string | undefined;
1255
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1256
+ semantic_expr?: string | undefined;
1257
+ semantic_label?: string | undefined;
1258
+ ui_label?: string | undefined;
1259
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1260
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1261
+ ui_group?: string | undefined;
1262
+ ui_sortable?: boolean | undefined;
1263
+ ui_filterable?: boolean | undefined;
1264
+ ui_visible?: boolean | undefined;
1265
+ ui_placeholder?: string | undefined;
1266
+ ui_help?: string | undefined;
1267
+ ui_format?: Record<string, unknown> | undefined;
1268
+ required?: boolean | undefined;
1269
+ nullable?: boolean | undefined;
1270
+ max_length?: number | undefined;
1271
+ min_length?: number | undefined;
1272
+ choices?: string[] | undefined;
1273
+ choices_from?: string | undefined;
1274
+ allowed_types?: string[] | undefined;
1275
+ default?: unknown;
1276
+ index?: boolean | undefined;
1277
+ foreign_key?: string | undefined;
1278
+ }>>;
1279
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1280
+ type: z.ZodEnum<["belongs_to", "has_many", "has_one"]>;
1281
+ target: z.ZodString;
1282
+ foreign_key: z.ZodString;
1283
+ through: z.ZodOptional<z.ZodString>;
1284
+ inverse: z.ZodOptional<z.ZodString>;
1285
+ }, "strict", z.ZodTypeAny, {
1286
+ type: "belongs_to" | "has_many" | "has_one";
1287
+ foreign_key: string;
1288
+ target: string;
1289
+ through?: string | undefined;
1290
+ inverse?: string | undefined;
1291
+ }, {
1292
+ type: "belongs_to" | "has_many" | "has_one";
1293
+ foreign_key: string;
1294
+ target: string;
1295
+ through?: string | undefined;
1296
+ inverse?: string | undefined;
1297
+ }>>>;
1298
+ behaviors: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
1299
+ name: z.ZodString;
1300
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1301
+ }, "strip", z.ZodTypeAny, {
1302
+ name: string;
1303
+ options?: Record<string, unknown> | undefined;
1304
+ }, {
1305
+ name: string;
1306
+ options?: Record<string, unknown> | undefined;
1307
+ }>]>, "many">>>;
1308
+ queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
1309
+ by: z.ZodArray<z.ZodString, "many">;
1310
+ unique: z.ZodOptional<z.ZodBoolean>;
1311
+ select: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1312
+ order: z.ZodOptional<z.ZodString>;
1313
+ limit: z.ZodOptional<z.ZodBoolean>;
1314
+ via: z.ZodOptional<z.ZodString>;
1315
+ }, "strip", z.ZodTypeAny, {
1316
+ by: string[];
1317
+ unique?: boolean | undefined;
1318
+ select?: string[] | undefined;
1319
+ order?: string | undefined;
1320
+ limit?: boolean | undefined;
1321
+ via?: string | undefined;
1322
+ }, {
1323
+ by: string[];
1324
+ unique?: boolean | undefined;
1325
+ select?: string[] | undefined;
1326
+ order?: string | undefined;
1327
+ limit?: boolean | undefined;
1328
+ via?: string | undefined;
1329
+ }>, "many">>;
1330
+ sync: z.ZodOptional<z.ZodObject<{
1331
+ electric: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1332
+ providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1333
+ remote_entity: z.ZodString;
1334
+ direction: z.ZodEnum<["inbound", "outbound", "bidirectional"]>;
1335
+ cdc: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1336
+ field_mapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1337
+ read_only_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1338
+ }, "strip", z.ZodTypeAny, {
1339
+ remote_entity: string;
1340
+ direction: "inbound" | "outbound" | "bidirectional";
1341
+ cdc: boolean;
1342
+ field_mapping?: Record<string, string> | undefined;
1343
+ read_only_fields?: string[] | undefined;
1344
+ }, {
1345
+ remote_entity: string;
1346
+ direction: "inbound" | "outbound" | "bidirectional";
1347
+ cdc?: boolean | undefined;
1348
+ field_mapping?: Record<string, string> | undefined;
1349
+ read_only_fields?: string[] | undefined;
1350
+ }>>>;
1351
+ }, "strip", z.ZodTypeAny, {
1352
+ electric: boolean;
1353
+ providers?: Record<string, {
1354
+ remote_entity: string;
1355
+ direction: "inbound" | "outbound" | "bidirectional";
1356
+ cdc: boolean;
1357
+ field_mapping?: Record<string, string> | undefined;
1358
+ read_only_fields?: string[] | undefined;
1359
+ }> | undefined;
1360
+ }, {
1361
+ electric?: boolean | undefined;
1362
+ providers?: Record<string, {
1363
+ remote_entity: string;
1364
+ direction: "inbound" | "outbound" | "bidirectional";
1365
+ cdc?: boolean | undefined;
1366
+ field_mapping?: Record<string, string> | undefined;
1367
+ read_only_fields?: string[] | undefined;
1368
+ }> | undefined;
1369
+ }>>;
1370
+ events: z.ZodOptional<z.ZodArray<z.ZodObject<{
1371
+ name: z.ZodString;
1372
+ queue: z.ZodString;
1373
+ body: z.ZodRecord<z.ZodString, z.ZodString>;
1374
+ generate_handler: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1375
+ }, "strip", z.ZodTypeAny, {
1376
+ name: string;
1377
+ queue: string;
1378
+ body: Record<string, string>;
1379
+ generate_handler: boolean;
1380
+ }, {
1381
+ name: string;
1382
+ queue: string;
1383
+ body: Record<string, string>;
1384
+ generate_handler?: boolean | undefined;
1385
+ }>, "many">>;
1386
+ analytics: z.ZodOptional<z.ZodObject<{
1387
+ measure_packs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1388
+ cube_name: z.ZodOptional<z.ZodString>;
1389
+ metrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1390
+ type: z.ZodLiteral<"simple">;
1391
+ measure: z.ZodString;
1392
+ agg: z.ZodOptional<z.ZodEnum<["sum", "min", "max", "count", "count_distinct", "average", "median", "percentile", "sum_boolean"]>>;
1393
+ filter: z.ZodOptional<z.ZodString>;
1394
+ description: z.ZodOptional<z.ZodString>;
1395
+ label: z.ZodOptional<z.ZodString>;
1396
+ }, "strip", z.ZodTypeAny, {
1397
+ type: "simple";
1398
+ measure: string;
1399
+ filter?: string | undefined;
1400
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1401
+ description?: string | undefined;
1402
+ label?: string | undefined;
1403
+ }, {
1404
+ type: "simple";
1405
+ measure: string;
1406
+ filter?: string | undefined;
1407
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1408
+ description?: string | undefined;
1409
+ label?: string | undefined;
1410
+ }>, z.ZodObject<{
1411
+ type: z.ZodLiteral<"derived">;
1412
+ expr: z.ZodString;
1413
+ metrics: z.ZodArray<z.ZodString, "many">;
1414
+ description: z.ZodOptional<z.ZodString>;
1415
+ label: z.ZodOptional<z.ZodString>;
1416
+ }, "strip", z.ZodTypeAny, {
1417
+ type: "derived";
1418
+ expr: string;
1419
+ metrics: string[];
1420
+ description?: string | undefined;
1421
+ label?: string | undefined;
1422
+ }, {
1423
+ type: "derived";
1424
+ expr: string;
1425
+ metrics: string[];
1426
+ description?: string | undefined;
1427
+ label?: string | undefined;
1428
+ }>, z.ZodObject<{
1429
+ type: z.ZodLiteral<"ratio">;
1430
+ numerator: z.ZodUnion<[z.ZodString, z.ZodObject<{
1431
+ type: z.ZodLiteral<"simple">;
1432
+ measure: z.ZodString;
1433
+ agg: z.ZodOptional<z.ZodEnum<["sum", "min", "max", "count", "count_distinct", "average", "median", "percentile", "sum_boolean"]>>;
1434
+ filter: z.ZodOptional<z.ZodString>;
1435
+ description: z.ZodOptional<z.ZodString>;
1436
+ label: z.ZodOptional<z.ZodString>;
1437
+ }, "strip", z.ZodTypeAny, {
1438
+ type: "simple";
1439
+ measure: string;
1440
+ filter?: string | undefined;
1441
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1442
+ description?: string | undefined;
1443
+ label?: string | undefined;
1444
+ }, {
1445
+ type: "simple";
1446
+ measure: string;
1447
+ filter?: string | undefined;
1448
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1449
+ description?: string | undefined;
1450
+ label?: string | undefined;
1451
+ }>]>;
1452
+ denominator: z.ZodUnion<[z.ZodString, z.ZodObject<{
1453
+ type: z.ZodLiteral<"simple">;
1454
+ measure: z.ZodString;
1455
+ agg: z.ZodOptional<z.ZodEnum<["sum", "min", "max", "count", "count_distinct", "average", "median", "percentile", "sum_boolean"]>>;
1456
+ filter: z.ZodOptional<z.ZodString>;
1457
+ description: z.ZodOptional<z.ZodString>;
1458
+ label: z.ZodOptional<z.ZodString>;
1459
+ }, "strip", z.ZodTypeAny, {
1460
+ type: "simple";
1461
+ measure: string;
1462
+ filter?: string | undefined;
1463
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1464
+ description?: string | undefined;
1465
+ label?: string | undefined;
1466
+ }, {
1467
+ type: "simple";
1468
+ measure: string;
1469
+ filter?: string | undefined;
1470
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1471
+ description?: string | undefined;
1472
+ label?: string | undefined;
1473
+ }>]>;
1474
+ filter: z.ZodOptional<z.ZodString>;
1475
+ description: z.ZodOptional<z.ZodString>;
1476
+ label: z.ZodOptional<z.ZodString>;
1477
+ }, "strip", z.ZodTypeAny, {
1478
+ type: "ratio";
1479
+ numerator: string | {
1480
+ type: "simple";
1481
+ measure: string;
1482
+ filter?: string | undefined;
1483
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1484
+ description?: string | undefined;
1485
+ label?: string | undefined;
1486
+ };
1487
+ denominator: string | {
1488
+ type: "simple";
1489
+ measure: string;
1490
+ filter?: string | undefined;
1491
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1492
+ description?: string | undefined;
1493
+ label?: string | undefined;
1494
+ };
1495
+ filter?: string | undefined;
1496
+ description?: string | undefined;
1497
+ label?: string | undefined;
1498
+ }, {
1499
+ type: "ratio";
1500
+ numerator: string | {
1501
+ type: "simple";
1502
+ measure: string;
1503
+ filter?: string | undefined;
1504
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1505
+ description?: string | undefined;
1506
+ label?: string | undefined;
1507
+ };
1508
+ denominator: string | {
1509
+ type: "simple";
1510
+ measure: string;
1511
+ filter?: string | undefined;
1512
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1513
+ description?: string | undefined;
1514
+ label?: string | undefined;
1515
+ };
1516
+ filter?: string | undefined;
1517
+ description?: string | undefined;
1518
+ label?: string | undefined;
1519
+ }>, z.ZodObject<{
1520
+ type: z.ZodLiteral<"cumulative">;
1521
+ measure: z.ZodString;
1522
+ window: z.ZodOptional<z.ZodString>;
1523
+ grain_to_date: z.ZodOptional<z.ZodEnum<["day", "week", "month", "quarter", "year"]>>;
1524
+ description: z.ZodOptional<z.ZodString>;
1525
+ label: z.ZodOptional<z.ZodString>;
1526
+ }, "strip", z.ZodTypeAny, {
1527
+ type: "cumulative";
1528
+ measure: string;
1529
+ description?: string | undefined;
1530
+ label?: string | undefined;
1531
+ window?: string | undefined;
1532
+ grain_to_date?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1533
+ }, {
1534
+ type: "cumulative";
1535
+ measure: string;
1536
+ description?: string | undefined;
1537
+ label?: string | undefined;
1538
+ window?: string | undefined;
1539
+ grain_to_date?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1540
+ }>]>>>;
1541
+ }, "strip", z.ZodTypeAny, {
1542
+ metrics?: Record<string, {
1543
+ type: "simple";
1544
+ measure: string;
1545
+ filter?: string | undefined;
1546
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1547
+ description?: string | undefined;
1548
+ label?: string | undefined;
1549
+ } | {
1550
+ type: "derived";
1551
+ expr: string;
1552
+ metrics: string[];
1553
+ description?: string | undefined;
1554
+ label?: string | undefined;
1555
+ } | {
1556
+ type: "ratio";
1557
+ numerator: string | {
1558
+ type: "simple";
1559
+ measure: string;
1560
+ filter?: string | undefined;
1561
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1562
+ description?: string | undefined;
1563
+ label?: string | undefined;
1564
+ };
1565
+ denominator: string | {
1566
+ type: "simple";
1567
+ measure: string;
1568
+ filter?: string | undefined;
1569
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1570
+ description?: string | undefined;
1571
+ label?: string | undefined;
1572
+ };
1573
+ filter?: string | undefined;
1574
+ description?: string | undefined;
1575
+ label?: string | undefined;
1576
+ } | {
1577
+ type: "cumulative";
1578
+ measure: string;
1579
+ description?: string | undefined;
1580
+ label?: string | undefined;
1581
+ window?: string | undefined;
1582
+ grain_to_date?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1583
+ }> | undefined;
1584
+ measure_packs?: string[] | undefined;
1585
+ cube_name?: string | undefined;
1586
+ }, {
1587
+ metrics?: Record<string, {
1588
+ type: "simple";
1589
+ measure: string;
1590
+ filter?: string | undefined;
1591
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1592
+ description?: string | undefined;
1593
+ label?: string | undefined;
1594
+ } | {
1595
+ type: "derived";
1596
+ expr: string;
1597
+ metrics: string[];
1598
+ description?: string | undefined;
1599
+ label?: string | undefined;
1600
+ } | {
1601
+ type: "ratio";
1602
+ numerator: string | {
1603
+ type: "simple";
1604
+ measure: string;
1605
+ filter?: string | undefined;
1606
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1607
+ description?: string | undefined;
1608
+ label?: string | undefined;
1609
+ };
1610
+ denominator: string | {
1611
+ type: "simple";
1612
+ measure: string;
1613
+ filter?: string | undefined;
1614
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1615
+ description?: string | undefined;
1616
+ label?: string | undefined;
1617
+ };
1618
+ filter?: string | undefined;
1619
+ description?: string | undefined;
1620
+ label?: string | undefined;
1621
+ } | {
1622
+ type: "cumulative";
1623
+ measure: string;
1624
+ description?: string | undefined;
1625
+ label?: string | undefined;
1626
+ window?: string | undefined;
1627
+ grain_to_date?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1628
+ }> | undefined;
1629
+ measure_packs?: string[] | undefined;
1630
+ cube_name?: string | undefined;
1631
+ }>>;
1632
+ }, "strict", z.ZodTypeAny, {
1633
+ entity: {
1634
+ name: string;
1635
+ plural: string;
1636
+ table: string;
1637
+ expose: ("repository" | "rest" | "trpc" | "electric")[];
1638
+ folder_structure?: "flat" | "nested" | undefined;
1639
+ file_grouping?: "separate" | "grouped" | undefined;
1640
+ behavior_strategy?: "base_class" | "inline" | undefined;
1641
+ family?: "base" | "synced" | "activity" | "knowledge" | "metadata" | undefined;
1642
+ };
1643
+ fields: Record<string, {
1644
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1645
+ required: boolean;
1646
+ nullable: boolean;
1647
+ min?: number | undefined;
1648
+ max?: number | undefined;
1649
+ unique?: boolean | undefined;
1650
+ measure?: boolean | undefined;
1651
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1652
+ agg_time_dimension?: string | undefined;
1653
+ non_additive_dimension?: string | {
1654
+ name: string;
1655
+ window_choice?: string | undefined;
1656
+ window_groupings?: string[] | undefined;
1657
+ } | undefined;
1658
+ dimension?: boolean | undefined;
1659
+ dimension_type?: "categorical" | "time" | undefined;
1660
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1661
+ is_partition?: boolean | undefined;
1662
+ entity?: boolean | undefined;
1663
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1664
+ entity_role?: string | undefined;
1665
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1666
+ semantic_expr?: string | undefined;
1667
+ semantic_label?: string | undefined;
1668
+ ui_label?: string | undefined;
1669
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1670
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1671
+ ui_group?: string | undefined;
1672
+ ui_sortable?: boolean | undefined;
1673
+ ui_filterable?: boolean | undefined;
1674
+ ui_visible?: boolean | undefined;
1675
+ ui_placeholder?: string | undefined;
1676
+ ui_help?: string | undefined;
1677
+ ui_format?: Record<string, unknown> | undefined;
1678
+ max_length?: number | undefined;
1679
+ min_length?: number | undefined;
1680
+ choices?: string[] | undefined;
1681
+ choices_from?: string | undefined;
1682
+ allowed_types?: string[] | undefined;
1683
+ default?: unknown;
1684
+ index?: boolean | undefined;
1685
+ foreign_key?: string | undefined;
1686
+ }>;
1687
+ behaviors: (string | {
1688
+ name: string;
1689
+ options?: Record<string, unknown> | undefined;
1690
+ })[];
1691
+ relationships?: Record<string, {
1692
+ type: "belongs_to" | "has_many" | "has_one";
1693
+ foreign_key: string;
1694
+ target: string;
1695
+ through?: string | undefined;
1696
+ inverse?: string | undefined;
1697
+ }> | undefined;
1698
+ queries?: {
1699
+ by: string[];
1700
+ unique?: boolean | undefined;
1701
+ select?: string[] | undefined;
1702
+ order?: string | undefined;
1703
+ limit?: boolean | undefined;
1704
+ via?: string | undefined;
1705
+ }[] | undefined;
1706
+ sync?: {
1707
+ electric: boolean;
1708
+ providers?: Record<string, {
1709
+ remote_entity: string;
1710
+ direction: "inbound" | "outbound" | "bidirectional";
1711
+ cdc: boolean;
1712
+ field_mapping?: Record<string, string> | undefined;
1713
+ read_only_fields?: string[] | undefined;
1714
+ }> | undefined;
1715
+ } | undefined;
1716
+ events?: {
1717
+ name: string;
1718
+ queue: string;
1719
+ body: Record<string, string>;
1720
+ generate_handler: boolean;
1721
+ }[] | undefined;
1722
+ analytics?: {
1723
+ metrics?: Record<string, {
1724
+ type: "simple";
1725
+ measure: string;
1726
+ filter?: string | undefined;
1727
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1728
+ description?: string | undefined;
1729
+ label?: string | undefined;
1730
+ } | {
1731
+ type: "derived";
1732
+ expr: string;
1733
+ metrics: string[];
1734
+ description?: string | undefined;
1735
+ label?: string | undefined;
1736
+ } | {
1737
+ type: "ratio";
1738
+ numerator: string | {
1739
+ type: "simple";
1740
+ measure: string;
1741
+ filter?: string | undefined;
1742
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1743
+ description?: string | undefined;
1744
+ label?: string | undefined;
1745
+ };
1746
+ denominator: string | {
1747
+ type: "simple";
1748
+ measure: string;
1749
+ filter?: string | undefined;
1750
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1751
+ description?: string | undefined;
1752
+ label?: string | undefined;
1753
+ };
1754
+ filter?: string | undefined;
1755
+ description?: string | undefined;
1756
+ label?: string | undefined;
1757
+ } | {
1758
+ type: "cumulative";
1759
+ measure: string;
1760
+ description?: string | undefined;
1761
+ label?: string | undefined;
1762
+ window?: string | undefined;
1763
+ grain_to_date?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1764
+ }> | undefined;
1765
+ measure_packs?: string[] | undefined;
1766
+ cube_name?: string | undefined;
1767
+ } | undefined;
1768
+ }, {
1769
+ entity: {
1770
+ name: string;
1771
+ plural: string;
1772
+ table: string;
1773
+ folder_structure?: "flat" | "nested" | undefined;
1774
+ file_grouping?: "separate" | "grouped" | undefined;
1775
+ behavior_strategy?: "base_class" | "inline" | undefined;
1776
+ expose?: ("repository" | "rest" | "trpc" | "electric")[] | undefined;
1777
+ family?: "base" | "synced" | "activity" | "knowledge" | "metadata" | undefined;
1778
+ };
1779
+ fields: Record<string, {
1780
+ type: "string" | "boolean" | "integer" | "decimal" | "uuid" | "date" | "datetime" | "json" | "entity_ref" | "string_array" | "enum";
1781
+ min?: number | undefined;
1782
+ max?: number | undefined;
1783
+ unique?: boolean | undefined;
1784
+ measure?: boolean | undefined;
1785
+ analytics_aggregation?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1786
+ agg_time_dimension?: string | undefined;
1787
+ non_additive_dimension?: string | {
1788
+ name: string;
1789
+ window_choice?: string | undefined;
1790
+ window_groupings?: string[] | undefined;
1791
+ } | undefined;
1792
+ dimension?: boolean | undefined;
1793
+ dimension_type?: "categorical" | "time" | undefined;
1794
+ time_granularity?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1795
+ is_partition?: boolean | undefined;
1796
+ entity?: boolean | undefined;
1797
+ entity_type?: "primary" | "unique" | "foreign" | "natural" | undefined;
1798
+ entity_role?: string | undefined;
1799
+ analytics_visibility?: "internal" | "agent" | "public" | undefined;
1800
+ semantic_expr?: string | undefined;
1801
+ semantic_label?: string | undefined;
1802
+ ui_label?: string | undefined;
1803
+ ui_type?: "number" | "boolean" | "date" | "datetime" | "json" | "enum" | "text" | "textarea" | "money" | "percentage" | "email" | "url" | "reference" | "badge" | "password" | undefined;
1804
+ ui_importance?: "primary" | "secondary" | "tertiary" | undefined;
1805
+ ui_group?: string | undefined;
1806
+ ui_sortable?: boolean | undefined;
1807
+ ui_filterable?: boolean | undefined;
1808
+ ui_visible?: boolean | undefined;
1809
+ ui_placeholder?: string | undefined;
1810
+ ui_help?: string | undefined;
1811
+ ui_format?: Record<string, unknown> | undefined;
1812
+ required?: boolean | undefined;
1813
+ nullable?: boolean | undefined;
1814
+ max_length?: number | undefined;
1815
+ min_length?: number | undefined;
1816
+ choices?: string[] | undefined;
1817
+ choices_from?: string | undefined;
1818
+ allowed_types?: string[] | undefined;
1819
+ default?: unknown;
1820
+ index?: boolean | undefined;
1821
+ foreign_key?: string | undefined;
1822
+ }>;
1823
+ relationships?: Record<string, {
1824
+ type: "belongs_to" | "has_many" | "has_one";
1825
+ foreign_key: string;
1826
+ target: string;
1827
+ through?: string | undefined;
1828
+ inverse?: string | undefined;
1829
+ }> | undefined;
1830
+ behaviors?: (string | {
1831
+ name: string;
1832
+ options?: Record<string, unknown> | undefined;
1833
+ })[] | undefined;
1834
+ queries?: {
1835
+ by: string[];
1836
+ unique?: boolean | undefined;
1837
+ select?: string[] | undefined;
1838
+ order?: string | undefined;
1839
+ limit?: boolean | undefined;
1840
+ via?: string | undefined;
1841
+ }[] | undefined;
1842
+ sync?: {
1843
+ electric?: boolean | undefined;
1844
+ providers?: Record<string, {
1845
+ remote_entity: string;
1846
+ direction: "inbound" | "outbound" | "bidirectional";
1847
+ cdc?: boolean | undefined;
1848
+ field_mapping?: Record<string, string> | undefined;
1849
+ read_only_fields?: string[] | undefined;
1850
+ }> | undefined;
1851
+ } | undefined;
1852
+ events?: {
1853
+ name: string;
1854
+ queue: string;
1855
+ body: Record<string, string>;
1856
+ generate_handler?: boolean | undefined;
1857
+ }[] | undefined;
1858
+ analytics?: {
1859
+ metrics?: Record<string, {
1860
+ type: "simple";
1861
+ measure: string;
1862
+ filter?: string | undefined;
1863
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1864
+ description?: string | undefined;
1865
+ label?: string | undefined;
1866
+ } | {
1867
+ type: "derived";
1868
+ expr: string;
1869
+ metrics: string[];
1870
+ description?: string | undefined;
1871
+ label?: string | undefined;
1872
+ } | {
1873
+ type: "ratio";
1874
+ numerator: string | {
1875
+ type: "simple";
1876
+ measure: string;
1877
+ filter?: string | undefined;
1878
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1879
+ description?: string | undefined;
1880
+ label?: string | undefined;
1881
+ };
1882
+ denominator: string | {
1883
+ type: "simple";
1884
+ measure: string;
1885
+ filter?: string | undefined;
1886
+ agg?: "sum" | "min" | "max" | "count" | "count_distinct" | "average" | "median" | "percentile" | "sum_boolean" | undefined;
1887
+ description?: string | undefined;
1888
+ label?: string | undefined;
1889
+ };
1890
+ filter?: string | undefined;
1891
+ description?: string | undefined;
1892
+ label?: string | undefined;
1893
+ } | {
1894
+ type: "cumulative";
1895
+ measure: string;
1896
+ description?: string | undefined;
1897
+ label?: string | undefined;
1898
+ window?: string | undefined;
1899
+ grain_to_date?: "day" | "week" | "month" | "quarter" | "year" | undefined;
1900
+ }> | undefined;
1901
+ measure_packs?: string[] | undefined;
1902
+ cube_name?: string | undefined;
1903
+ } | undefined;
1904
+ }>;
1905
+ type EntityDefinition = z.infer<typeof EntityDefinitionSchema>;
1906
+
1907
+ /**
1908
+ * Complete relationship definition — the top-level shape of a relationship YAML file.
1909
+ *
1910
+ * Example (minimal):
1911
+ * relationship:
1912
+ * name: engagement_opportunity
1913
+ * from: engagement
1914
+ * to: opportunity
1915
+ *
1916
+ * Example (full):
1917
+ * relationship:
1918
+ * name: person_organization
1919
+ * table: person_organizations
1920
+ * from: person
1921
+ * to: organization
1922
+ * types: [employed_by, advises, board_member]
1923
+ * temporal: true
1924
+ * sourced: true
1925
+ * fields:
1926
+ * role_title:
1927
+ * type: string
1928
+ * nullable: true
1929
+ * queries:
1930
+ * - by: [person_id]
1931
+ */
1932
+ declare const RelationshipDefinitionSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
1933
+ /** Relationship configuration block */
1934
+ relationship: z.ZodObject<{
1935
+ /** Relationship name (snake_case). Used for class/file naming. */
1936
+ name: z.ZodString;
1937
+ /** Database table name. Defaults to {name}s if not specified. */
1938
+ table: z.ZodOptional<z.ZodString>;
1939
+ /** The "from" entity — generates {entity}_id FK column (subject). */
1940
+ from: z.ZodString;
1941
+ /** The "to" entity — generates {entity}_id FK column (object). */
1942
+ to: z.ZodString;
1943
+ /**
1944
+ * Relationship subtypes. Optional — omit for untyped junctions.
1945
+ * When present, generates a `type` enum column on the junction table.
1946
+ *
1947
+ * Simple list: all types are directed (from→to). Use for cross-type
1948
+ * relationships where entity asymmetry makes direction obvious.
1949
+ *
1950
+ * Object map: each type declares its own direction metadata.
1951
+ * Required for self-referential relationships (from === to).
1952
+ */
1953
+ types: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
1954
+ /** Name of the inverse type when viewed from the other direction */
1955
+ inverse: z.ZodOptional<z.ZodString>;
1956
+ /** Both directions are equivalent — queries should check both FK columns */
1957
+ bidirectional: z.ZodOptional<z.ZodBoolean>;
1958
+ /** Explicitly directed, no named inverse (default behavior) */
1959
+ directed: z.ZodOptional<z.ZodBoolean>;
1960
+ }, "strip", z.ZodTypeAny, {
1961
+ inverse?: string | undefined;
1962
+ bidirectional?: boolean | undefined;
1963
+ directed?: boolean | undefined;
1964
+ }, {
1965
+ inverse?: string | undefined;
1966
+ bidirectional?: boolean | undefined;
1967
+ directed?: boolean | undefined;
1968
+ }>, {
1969
+ inverse?: string | undefined;
1970
+ bidirectional?: boolean | undefined;
1971
+ directed?: boolean | undefined;
1972
+ }, {
1973
+ inverse?: string | undefined;
1974
+ bidirectional?: boolean | undefined;
1975
+ directed?: boolean | undefined;
1976
+ }>>]>>;
1977
+ /**
1978
+ * Generate temporal validity fields: valid_from (date), valid_to (date?),
1979
+ * is_current (boolean, denormalized for query performance).
1980
+ * Default: true
1981
+ */
1982
+ temporal: z.ZodDefault<z.ZodBoolean>;
1983
+ /**
1984
+ * Generate source tracking fields: source (enum), confidence (decimal 0-1).
1985
+ * Default: true
1986
+ */
1987
+ sourced: z.ZodDefault<z.ZodBoolean>;
1988
+ /** on_delete action for the "from" endpoint FK. Default: restrict */
1989
+ on_delete_from: z.ZodOptional<z.ZodDefault<z.ZodEnum<["restrict", "cascade", "set_null", "no_action"]>>>;
1990
+ /** on_delete action for the "to" endpoint FK. Default: restrict */
1991
+ on_delete_to: z.ZodOptional<z.ZodDefault<z.ZodEnum<["restrict", "cascade", "set_null", "no_action"]>>>;
1992
+ /**
1993
+ * Override the default unique constraint columns.
1994
+ *
1995
+ * Defaults:
1996
+ * - Typed: [from_id, to_id, type]
1997
+ * - Typed + temporal: [from_id, to_id, type, valid_from]
1998
+ * - Untyped: [from_id, to_id]
1999
+ *
2000
+ * Use this when the default doesn't fit — e.g., allowing multiple
2001
+ * relationships of the same type between the same entities at different times.
2002
+ */
2003
+ unique_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2004
+ }, "strict", z.ZodTypeAny, {
2005
+ name: string;
2006
+ from: string;
2007
+ to: string;
2008
+ temporal: boolean;
2009
+ sourced: boolean;
2010
+ table?: string | undefined;
2011
+ types?: string[] | Record<string, {
2012
+ inverse?: string | undefined;
2013
+ bidirectional?: boolean | undefined;
2014
+ directed?: boolean | undefined;
2015
+ }> | undefined;
2016
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2017
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2018
+ unique_on?: string[] | undefined;
2019
+ }, {
2020
+ name: string;
2021
+ from: string;
2022
+ to: string;
2023
+ table?: string | undefined;
2024
+ types?: string[] | Record<string, {
2025
+ inverse?: string | undefined;
2026
+ bidirectional?: boolean | undefined;
2027
+ directed?: boolean | undefined;
2028
+ }> | undefined;
2029
+ temporal?: boolean | undefined;
2030
+ sourced?: boolean | undefined;
2031
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2032
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2033
+ unique_on?: string[] | undefined;
2034
+ }>;
2035
+ /**
2036
+ * Additional fields beyond auto-generated ones.
2037
+ * These describe the relationship, not either endpoint entity.
2038
+ * Uses the same field definition schema as entity fields.
2039
+ */
2040
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2041
+ /** Declarative queries — same syntax as entity queries. */
2042
+ queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
2043
+ by: z.ZodArray<z.ZodString, "many">;
2044
+ unique: z.ZodOptional<z.ZodBoolean>;
2045
+ select: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2046
+ order: z.ZodOptional<z.ZodString>;
2047
+ limit: z.ZodOptional<z.ZodBoolean>;
2048
+ }, "strip", z.ZodTypeAny, {
2049
+ by: string[];
2050
+ unique?: boolean | undefined;
2051
+ select?: string[] | undefined;
2052
+ order?: string | undefined;
2053
+ limit?: boolean | undefined;
2054
+ }, {
2055
+ by: string[];
2056
+ unique?: boolean | undefined;
2057
+ select?: string[] | undefined;
2058
+ order?: string | undefined;
2059
+ limit?: boolean | undefined;
2060
+ }>, "many">>;
2061
+ }, "strict", z.ZodTypeAny, {
2062
+ relationship: {
2063
+ name: string;
2064
+ from: string;
2065
+ to: string;
2066
+ temporal: boolean;
2067
+ sourced: boolean;
2068
+ table?: string | undefined;
2069
+ types?: string[] | Record<string, {
2070
+ inverse?: string | undefined;
2071
+ bidirectional?: boolean | undefined;
2072
+ directed?: boolean | undefined;
2073
+ }> | undefined;
2074
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2075
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2076
+ unique_on?: string[] | undefined;
2077
+ };
2078
+ fields?: Record<string, any> | undefined;
2079
+ queries?: {
2080
+ by: string[];
2081
+ unique?: boolean | undefined;
2082
+ select?: string[] | undefined;
2083
+ order?: string | undefined;
2084
+ limit?: boolean | undefined;
2085
+ }[] | undefined;
2086
+ }, {
2087
+ relationship: {
2088
+ name: string;
2089
+ from: string;
2090
+ to: string;
2091
+ table?: string | undefined;
2092
+ types?: string[] | Record<string, {
2093
+ inverse?: string | undefined;
2094
+ bidirectional?: boolean | undefined;
2095
+ directed?: boolean | undefined;
2096
+ }> | undefined;
2097
+ temporal?: boolean | undefined;
2098
+ sourced?: boolean | undefined;
2099
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2100
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2101
+ unique_on?: string[] | undefined;
2102
+ };
2103
+ fields?: Record<string, any> | undefined;
2104
+ queries?: {
2105
+ by: string[];
2106
+ unique?: boolean | undefined;
2107
+ select?: string[] | undefined;
2108
+ order?: string | undefined;
2109
+ limit?: boolean | undefined;
2110
+ }[] | undefined;
2111
+ }>, {
2112
+ relationship: {
2113
+ name: string;
2114
+ from: string;
2115
+ to: string;
2116
+ temporal: boolean;
2117
+ sourced: boolean;
2118
+ table?: string | undefined;
2119
+ types?: string[] | Record<string, {
2120
+ inverse?: string | undefined;
2121
+ bidirectional?: boolean | undefined;
2122
+ directed?: boolean | undefined;
2123
+ }> | undefined;
2124
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2125
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2126
+ unique_on?: string[] | undefined;
2127
+ };
2128
+ fields?: Record<string, any> | undefined;
2129
+ queries?: {
2130
+ by: string[];
2131
+ unique?: boolean | undefined;
2132
+ select?: string[] | undefined;
2133
+ order?: string | undefined;
2134
+ limit?: boolean | undefined;
2135
+ }[] | undefined;
2136
+ }, {
2137
+ relationship: {
2138
+ name: string;
2139
+ from: string;
2140
+ to: string;
2141
+ table?: string | undefined;
2142
+ types?: string[] | Record<string, {
2143
+ inverse?: string | undefined;
2144
+ bidirectional?: boolean | undefined;
2145
+ directed?: boolean | undefined;
2146
+ }> | undefined;
2147
+ temporal?: boolean | undefined;
2148
+ sourced?: boolean | undefined;
2149
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2150
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2151
+ unique_on?: string[] | undefined;
2152
+ };
2153
+ fields?: Record<string, any> | undefined;
2154
+ queries?: {
2155
+ by: string[];
2156
+ unique?: boolean | undefined;
2157
+ select?: string[] | undefined;
2158
+ order?: string | undefined;
2159
+ limit?: boolean | undefined;
2160
+ }[] | undefined;
2161
+ }>, {
2162
+ relationship: {
2163
+ name: string;
2164
+ from: string;
2165
+ to: string;
2166
+ temporal: boolean;
2167
+ sourced: boolean;
2168
+ table?: string | undefined;
2169
+ types?: string[] | Record<string, {
2170
+ inverse?: string | undefined;
2171
+ bidirectional?: boolean | undefined;
2172
+ directed?: boolean | undefined;
2173
+ }> | undefined;
2174
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2175
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2176
+ unique_on?: string[] | undefined;
2177
+ };
2178
+ fields?: Record<string, any> | undefined;
2179
+ queries?: {
2180
+ by: string[];
2181
+ unique?: boolean | undefined;
2182
+ select?: string[] | undefined;
2183
+ order?: string | undefined;
2184
+ limit?: boolean | undefined;
2185
+ }[] | undefined;
2186
+ }, {
2187
+ relationship: {
2188
+ name: string;
2189
+ from: string;
2190
+ to: string;
2191
+ table?: string | undefined;
2192
+ types?: string[] | Record<string, {
2193
+ inverse?: string | undefined;
2194
+ bidirectional?: boolean | undefined;
2195
+ directed?: boolean | undefined;
2196
+ }> | undefined;
2197
+ temporal?: boolean | undefined;
2198
+ sourced?: boolean | undefined;
2199
+ on_delete_from?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2200
+ on_delete_to?: "restrict" | "cascade" | "set_null" | "no_action" | undefined;
2201
+ unique_on?: string[] | undefined;
2202
+ };
2203
+ fields?: Record<string, any> | undefined;
2204
+ queries?: {
2205
+ by: string[];
2206
+ unique?: boolean | undefined;
2207
+ select?: string[] | undefined;
2208
+ order?: string | undefined;
2209
+ limit?: boolean | undefined;
2210
+ }[] | undefined;
2211
+ }>;
2212
+ type RelationshipDefinition = z.infer<typeof RelationshipDefinitionSchema>;
2213
+
2214
+ interface LoadResult {
2215
+ success: true;
2216
+ definition: EntityDefinition;
2217
+ filePath: string;
2218
+ }
2219
+ interface LoadError {
2220
+ success: false;
2221
+ error: string;
2222
+ details?: string[];
2223
+ filePath: string;
2224
+ }
2225
+ type LoadEntityResult = LoadResult | LoadError;
2226
+ /**
2227
+ * Load and validate an entity definition from a YAML file
2228
+ */
2229
+ declare function loadEntityFromYaml(filePath: string): LoadEntityResult;
2230
+ interface RelationshipLoadResult {
2231
+ success: true;
2232
+ definition: RelationshipDefinition;
2233
+ filePath: string;
2234
+ }
2235
+ interface RelationshipLoadError {
2236
+ success: false;
2237
+ error: string;
2238
+ details?: string[];
2239
+ filePath: string;
2240
+ }
2241
+ type LoadRelationshipResult = RelationshipLoadResult | RelationshipLoadError;
2242
+ /**
2243
+ * Load and validate a relationship definition from a YAML file
2244
+ */
2245
+ declare function loadRelationshipFromYaml(filePath: string): LoadRelationshipResult;
2246
+
2247
+ /**
2248
+ * Entity Loader
2249
+ *
2250
+ * Loads and parses all YAML entity files from a directory.
2251
+ * Reuses existing yaml-loader and entity-definition schema from codegen.
2252
+ */
2253
+
2254
+ interface LoadEntitiesResult {
2255
+ entities: ParsedEntity[];
2256
+ issues: AnalysisIssue[];
2257
+ }
2258
+ /**
2259
+ * Load all entity YAML files from a directory
2260
+ */
2261
+ declare function loadEntities(entitiesDir: string): LoadEntitiesResult;
2262
+ interface LoadRelationshipsResult {
2263
+ relationships: ParsedRelationshipDefinition[];
2264
+ issues: AnalysisIssue[];
2265
+ }
2266
+ /**
2267
+ * Load all relationship YAML files from a directory
2268
+ */
2269
+ declare function loadRelationships(relationshipsDir: string): LoadRelationshipsResult;
2270
+
2271
+ /**
2272
+ * Graph Builder
2273
+ *
2274
+ * Builds a domain graph from parsed entities, including nodes and edges.
2275
+ * Tracks bidirectional connections between entities.
2276
+ */
2277
+
2278
+ /**
2279
+ * Build a domain graph from parsed entities
2280
+ */
2281
+ declare function buildDomainGraph(entities: ParsedEntity[], relationshipDefinitions?: ParsedRelationshipDefinition[]): DomainGraph;
2282
+ /**
2283
+ * Get all entities related to a given entity within a specified depth
2284
+ */
2285
+ declare function getRelatedEntities(graph: DomainGraph, entityName: string, depth?: number): Set<string>;
2286
+ /**
2287
+ * Find entities with no relationships (orphans)
2288
+ */
2289
+ declare function findOrphanEntities(graph: DomainGraph): string[];
2290
+ /**
2291
+ * Find circular dependencies in the graph
2292
+ */
2293
+ declare function findCircularDependencies(graph: DomainGraph): string[][];
2294
+
2295
+ /**
2296
+ * Consistency Checker
2297
+ *
2298
+ * Performs various consistency checks on the domain model:
2299
+ * - Missing relationship targets
2300
+ * - Missing inverse relationships
2301
+ * - Missing indexes on filterable fields
2302
+ * - Orphan entities (no relationships)
2303
+ * - Circular dependencies
2304
+ * - Naming conventions
2305
+ * - Missing UI metadata
2306
+ */
2307
+
2308
+ /**
2309
+ * Run all consistency checks on the domain graph
2310
+ */
2311
+ declare function checkConsistency(graph: DomainGraph): AnalysisIssue[];
2312
+
2313
+ /**
2314
+ * Statistics
2315
+ *
2316
+ * Computes statistics about the domain model:
2317
+ * - Entity counts
2318
+ * - Field counts and type distribution
2319
+ * - Relationship counts and type distribution
2320
+ */
2321
+
2322
+ /**
2323
+ * Compute domain statistics from the graph
2324
+ */
2325
+ declare function computeStatistics(graph: DomainGraph): DomainStatistics;
2326
+
2327
+ /**
2328
+ * Console Formatter
2329
+ *
2330
+ * Pretty terminal output with colors for the domain analysis results.
2331
+ */
2332
+
2333
+ /**
2334
+ * Format analysis result for console output
2335
+ */
2336
+ declare function formatConsole(result: AnalysisResult): string;
2337
+
2338
+ /**
2339
+ * JSON Formatter
2340
+ *
2341
+ * Machine-readable JSON output for the domain analysis results.
2342
+ */
2343
+
2344
+ /**
2345
+ * Format analysis result as JSON string
2346
+ */
2347
+ declare function formatJson(result: AnalysisResult, pretty?: boolean): string;
2348
+
2349
+ /**
2350
+ * Markdown Formatter
2351
+ *
2352
+ * Documentation output with Mermaid diagrams for the domain analysis results.
2353
+ */
2354
+
2355
+ /**
2356
+ * Format analysis result as Markdown documentation
2357
+ */
2358
+ declare function formatMarkdown(result: AnalysisResult): string;
2359
+ /**
2360
+ * Generate a simple relationship graph in Mermaid
2361
+ */
2362
+ declare function formatMermaidGraph(result: AnalysisResult): string;
2363
+
2364
+ /**
2365
+ * Entity Codegen & Domain Analyzer
2366
+ *
2367
+ * A validation and analysis tool for entity YAML definitions.
2368
+ * Parses entities, builds a relationship graph, and detects issues.
2369
+ */
2370
+
2371
+ /**
2372
+ * Analyze a domain from entity and relationship YAML files
2373
+ */
2374
+ declare function analyzeDomain(entitiesDir: string, relationshipsDir?: string): Promise<AnalysisResult>;
2375
+ /**
2376
+ * Validate entity files without full analysis
2377
+ * Returns true if all files parse successfully
2378
+ */
2379
+ declare function validateEntities(entitiesDir: string): {
2380
+ valid: boolean;
2381
+ errors: string[];
2382
+ };
2383
+
2384
+ export { type AnalysisIssue, type AnalysisResult, type CodegenManifest, type DomainGraph, type DomainStatistics, type EntityFamily, type EntityNode, type ManifestEntity, type ManifestField, type ManifestRelationship, type ManifestSuggestion, type OutputFormat, type ParsedEntity, type ParsedEvent, type ParsedField, type ParsedProviderSync, type ParsedQuery, type ParsedRelationship, type ParsedRelationshipDefinition, type ParsedSync, type ParsedTypeDirection, type PathHop, type RelationshipEdge, type Severity, type TransitivePath, type TransitiveSuggestion, analyzeDomain, buildDomainGraph, checkConsistency, computeStatistics, findCircularDependencies, findOrphanEntities, formatConsole, formatJson, formatMarkdown, formatMermaidGraph, getRelatedEntities, loadEntities, loadEntityFromYaml, loadRelationshipFromYaml, loadRelationships, validateEntities };