@owox/backend 0.35.0 → 0.36.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 (283) hide show
  1. package/dist/src/common/exceptions/concurrency-limit-exceeded.exception.d.ts +1 -1
  2. package/dist/src/common/exceptions/concurrency-limit-exceeded.exception.js +2 -2
  3. package/dist/src/common/markdown/markdown-parser.service.d.ts +2 -0
  4. package/dist/src/common/markdown/markdown-parser.service.js +15 -8
  5. package/dist/src/common/validators/max-byte-length.validator.d.ts +2 -0
  6. package/dist/src/common/validators/max-byte-length.validator.js +29 -0
  7. package/dist/src/config/env-validation.config.d.ts +12 -0
  8. package/dist/src/config/env-validation.config.js +7 -0
  9. package/dist/src/data-marts/ai-insights/agent/types.d.ts +6 -6
  10. package/dist/src/data-marts/calculated-fields/calculated-field-validator.service.js +22 -30
  11. package/dist/src/data-marts/calculated-fields/calculated-field.utils.d.ts +1 -0
  12. package/dist/src/data-marts/calculated-fields/calculated-field.utils.js +21 -0
  13. package/dist/src/data-marts/calculated-fields/formula-analyzer.d.ts +1 -0
  14. package/dist/src/data-marts/calculated-fields/formula-analyzer.js +2 -0
  15. package/dist/src/data-marts/calculated-fields/formula-violations.d.ts +7 -0
  16. package/dist/src/data-marts/calculated-fields/formula-violations.js +82 -1
  17. package/dist/src/data-marts/calculated-fields/join-grain.d.ts +32 -0
  18. package/dist/src/data-marts/calculated-fields/join-grain.js +107 -0
  19. package/dist/src/data-marts/calculated-fields/set-quantifier.d.ts +8 -0
  20. package/dist/src/data-marts/calculated-fields/set-quantifier.js +12 -0
  21. package/dist/src/data-marts/connector-types/connector-message/schemas/connector-message.schema.d.ts +66 -0
  22. package/dist/src/data-marts/connector-types/connector-message/schemas/connector-message.schema.js +13 -1
  23. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-credentials-update.schema.d.ts +3 -0
  24. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-credentials-update.schema.js +1 -0
  25. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-error.schema.d.ts +3 -0
  26. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-error.schema.js +1 -0
  27. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-log.schema.d.ts +12 -0
  28. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-log.schema.js +4 -0
  29. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-requested-date.schema.d.ts +3 -0
  30. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-requested-date.schema.js +1 -0
  31. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-state-update.schema.d.ts +16 -0
  32. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-state-update.schema.js +16 -0
  33. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-status.schema.d.ts +3 -0
  34. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-status.schema.js +1 -0
  35. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-warning.schema.d.ts +3 -0
  36. package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-warning.schema.js +1 -0
  37. package/dist/src/data-marts/connector-types/connector-message/services/connector-event.translator.d.ts +10 -0
  38. package/dist/src/data-marts/connector-types/connector-message/services/connector-event.translator.js +138 -0
  39. package/dist/src/data-marts/connector-types/connector-message/services/connector-message-parser.service.d.ts +1 -3
  40. package/dist/src/data-marts/connector-types/connector-message/services/connector-message-parser.service.js +30 -34
  41. package/dist/src/data-marts/connector-types/connector-message/services/connector-output-capture.service.js +10 -12
  42. package/dist/src/data-marts/connector-types/connector-message/services/connector-state.service.js +3 -1
  43. package/dist/src/data-marts/connector-types/enums/connector-message-type-enum.d.ts +1 -0
  44. package/dist/src/data-marts/connector-types/enums/connector-message-type-enum.js +1 -0
  45. package/dist/src/data-marts/controllers/connector-definition.controller.d.ts +30 -0
  46. package/dist/src/data-marts/controllers/connector-definition.controller.js +252 -0
  47. package/dist/src/data-marts/controllers/data-mart-preview.controller.d.ts +10 -0
  48. package/dist/src/data-marts/controllers/data-mart-preview.controller.js +58 -0
  49. package/dist/src/data-marts/controllers/data-mart.controller.d.ts +5 -1
  50. package/dist/src/data-marts/controllers/data-mart.controller.js +25 -4
  51. package/dist/src/data-marts/controllers/insight-template.controller.js +4 -4
  52. package/dist/src/data-marts/controllers/insight.controller.js +5 -5
  53. package/dist/src/data-marts/controllers/project-data-mart-runs.controller.js +1 -1
  54. package/dist/src/data-marts/controllers/spec/connector-definition.api.d.ts +12 -0
  55. package/dist/src/data-marts/controllers/spec/connector-definition.api.js +179 -0
  56. package/dist/src/data-marts/controllers/spec/data-mart.api.d.ts +1 -0
  57. package/dist/src/data-marts/controllers/spec/data-mart.api.js +5 -0
  58. package/dist/src/data-marts/controllers/spec/report-openapi.d.ts +18 -0
  59. package/dist/src/data-marts/controllers/spec/report-openapi.js +3 -0
  60. package/dist/src/data-marts/data-marts.module.js +20 -2
  61. package/dist/src/data-marts/data-storage-types/blending/metric-sleeve.planner.js +3 -12
  62. package/dist/src/data-marts/data-storage-types/data-mart-schema.utils.d.ts +1 -0
  63. package/dist/src/data-marts/data-storage-types/data-mart-schema.utils.js +16 -0
  64. package/dist/src/data-marts/dto/domain/blendable-schema.dto.d.ts +10 -0
  65. package/dist/src/data-marts/dto/domain/blendable-schema.dto.js +71 -1
  66. package/dist/src/data-marts/dto/domain/create-data-mart.command.d.ts +3 -1
  67. package/dist/src/data-marts/dto/domain/create-data-mart.command.js +3 -1
  68. package/dist/src/data-marts/dto/domain/create-report.command.d.ts +3 -1
  69. package/dist/src/data-marts/dto/domain/create-report.command.js +3 -1
  70. package/dist/src/data-marts/dto/domain/data-mart-list-item.dto.d.ts +3 -1
  71. package/dist/src/data-marts/dto/domain/data-mart-list-item.dto.js +3 -1
  72. package/dist/src/data-marts/dto/domain/data-mart.dto.d.ts +4 -1
  73. package/dist/src/data-marts/dto/domain/data-mart.dto.js +5 -1
  74. package/dist/src/data-marts/dto/domain/model-canvas.dto.d.ts +4 -0
  75. package/dist/src/data-marts/dto/domain/report-like-read-plan.d.ts +2 -0
  76. package/dist/src/data-marts/dto/domain/report.dto.d.ts +3 -1
  77. package/dist/src/data-marts/dto/domain/report.dto.js +3 -1
  78. package/dist/src/data-marts/dto/domain/update-data-mart-icon.command.d.ts +9 -0
  79. package/dist/src/data-marts/dto/domain/update-data-mart-icon.command.js +19 -0
  80. package/dist/src/data-marts/dto/domain/update-report.command.d.ts +3 -1
  81. package/dist/src/data-marts/dto/domain/update-report.command.js +3 -1
  82. package/dist/src/data-marts/dto/presentation/create-data-mart-request-api.dto.d.ts +2 -0
  83. package/dist/src/data-marts/dto/presentation/create-data-mart-request-api.dto.js +13 -0
  84. package/dist/src/data-marts/dto/presentation/create-report-request-api.dto.d.ts +2 -0
  85. package/dist/src/data-marts/dto/presentation/create-report-request-api.dto.js +10 -0
  86. package/dist/src/data-marts/dto/presentation/custom-connector-response.dto.d.ts +46 -0
  87. package/dist/src/data-marts/dto/presentation/custom-connector-response.dto.js +216 -0
  88. package/dist/src/data-marts/dto/presentation/custom-connector.dto.d.ts +27 -0
  89. package/dist/src/data-marts/dto/presentation/custom-connector.dto.js +159 -0
  90. package/dist/src/data-marts/dto/presentation/data-mart-list-item-response-api.dto.d.ts +2 -0
  91. package/dist/src/data-marts/dto/presentation/data-mart-list-item-response-api.dto.js +10 -0
  92. package/dist/src/data-marts/dto/presentation/data-mart-response-api.dto.d.ts +2 -0
  93. package/dist/src/data-marts/dto/presentation/data-mart-response-api.dto.js +10 -0
  94. package/dist/src/data-marts/dto/presentation/model-canvas-response-api.dto.d.ts +4 -0
  95. package/dist/src/data-marts/dto/presentation/model-canvas-response-api.dto.js +20 -0
  96. package/dist/src/data-marts/dto/presentation/preview-data-mart-request-api.dto.d.ts +7 -0
  97. package/dist/src/data-marts/dto/presentation/preview-data-mart-request-api.dto.js +56 -0
  98. package/dist/src/data-marts/dto/presentation/preview-data-mart-response-api.dto.d.ts +12 -0
  99. package/dist/src/data-marts/dto/presentation/preview-data-mart-response-api.dto.js +64 -0
  100. package/dist/src/data-marts/dto/presentation/report-response-api.dto.d.ts +2 -0
  101. package/dist/src/data-marts/dto/presentation/report-response-api.dto.js +6 -0
  102. package/dist/src/data-marts/dto/presentation/run-data-mart-request-api.dto.js +67 -0
  103. package/dist/src/data-marts/dto/presentation/update-data-mart-description-api.dto.js +3 -0
  104. package/dist/src/data-marts/dto/presentation/update-data-mart-icon-api.dto.d.ts +4 -0
  105. package/dist/src/data-marts/dto/presentation/update-data-mart-icon-api.dto.js +30 -0
  106. package/dist/src/data-marts/dto/presentation/update-report-request-api.dto.d.ts +2 -0
  107. package/dist/src/data-marts/dto/presentation/update-report-request-api.dto.js +10 -0
  108. package/dist/src/data-marts/dto/schemas/auto-aggregation-opt-out.schema.d.ts +15 -0
  109. package/dist/src/data-marts/dto/schemas/auto-aggregation-opt-out.schema.js +29 -0
  110. package/dist/src/data-marts/dto/schemas/data-mart-run/data-mart-run.schema.d.ts +9 -0
  111. package/dist/src/data-marts/dto/schemas/data-mart-table-definitions/connector-definition.schema.d.ts +15 -0
  112. package/dist/src/data-marts/dto/schemas/data-mart-table-definitions/connector-definition.schema.js +1 -0
  113. package/dist/src/data-marts/dto/schemas/data-mart-table-definitions/data-mart-definition.schema.d.ts +7 -0
  114. package/dist/src/data-marts/dto/schemas/data-quality/data-quality-run.schema.d.ts +20 -0
  115. package/dist/src/data-marts/entities/connector-definition-version.entity.d.ts +16 -0
  116. package/dist/src/data-marts/entities/connector-definition-version.entity.js +78 -0
  117. package/dist/src/data-marts/entities/connector-definition.entity.d.ts +14 -0
  118. package/dist/src/data-marts/entities/connector-definition.entity.js +82 -0
  119. package/dist/src/data-marts/entities/data-mart.entity.d.ts +2 -0
  120. package/dist/src/data-marts/entities/data-mart.entity.js +5 -0
  121. package/dist/src/data-marts/entities/report.entity.d.ts +2 -0
  122. package/dist/src/data-marts/entities/report.entity.js +11 -0
  123. package/dist/src/data-marts/enums/data-mart-icon.enum.d.ts +75 -0
  124. package/dist/src/data-marts/enums/data-mart-icon.enum.js +80 -0
  125. package/dist/src/data-marts/errors/connector-credential-boundary.error.d.ts +3 -0
  126. package/dist/src/data-marts/errors/connector-credential-boundary.error.js +14 -0
  127. package/dist/src/data-marts/facades/mcp-data-marts.facade.d.ts +2 -0
  128. package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.d.ts +7 -1
  129. package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.js +70 -5
  130. package/dist/src/data-marts/mappers/connector-definition.mapper.d.ts +14 -0
  131. package/dist/src/data-marts/mappers/connector-definition.mapper.js +57 -0
  132. package/dist/src/data-marts/mappers/data-mart.mapper.d.ts +9 -6
  133. package/dist/src/data-marts/mappers/data-mart.mapper.js +44 -19
  134. package/dist/src/data-marts/mappers/insight-template.mapper.d.ts +1 -1
  135. package/dist/src/data-marts/mappers/insight-template.mapper.js +2 -2
  136. package/dist/src/data-marts/mappers/insight.mapper.d.ts +1 -1
  137. package/dist/src/data-marts/mappers/insight.mapper.js +2 -2
  138. package/dist/src/data-marts/mappers/model-canvas.mapper.d.ts +10 -2
  139. package/dist/src/data-marts/mappers/model-canvas.mapper.js +9 -3
  140. package/dist/src/data-marts/mappers/report.mapper.js +4 -3
  141. package/dist/src/data-marts/services/auto-collapse.resolver.d.ts +1 -1
  142. package/dist/src/data-marts/services/auto-collapse.resolver.js +4 -0
  143. package/dist/src/data-marts/services/blendable-schema.service.d.ts +2 -0
  144. package/dist/src/data-marts/services/blendable-schema.service.js +59 -0
  145. package/dist/src/data-marts/services/connector/connector-credential-injector.service.d.ts +1 -1
  146. package/dist/src/data-marts/services/connector/connector-credential-injector.service.js +15 -1
  147. package/dist/src/data-marts/services/connector/connector-definition.service.d.ts +59 -0
  148. package/dist/src/data-marts/services/connector/connector-definition.service.js +491 -0
  149. package/dist/src/data-marts/services/connector/connector-executor.service.d.ts +9 -1
  150. package/dist/src/data-marts/services/connector/connector-executor.service.js +173 -63
  151. package/dist/src/data-marts/services/connector/connector-fields-preview.service.js +1 -1
  152. package/dist/src/data-marts/services/connector/connector-message.utils.js +2 -2
  153. package/dist/src/data-marts/services/connector/connector-preview-credentials.service.js +1 -1
  154. package/dist/src/data-marts/services/connector/connector-preview-support.d.ts +1 -1
  155. package/dist/src/data-marts/services/connector/connector-preview-support.js +14 -21
  156. package/dist/src/data-marts/services/connector/connector-process-spawner.service.d.ts +11 -2
  157. package/dist/src/data-marts/services/connector/connector-process-spawner.service.js +88 -60
  158. package/dist/src/data-marts/services/connector/connector-secret.service.d.ts +6 -3
  159. package/dist/src/data-marts/services/connector/connector-secret.service.js +77 -12
  160. package/dist/src/data-marts/services/connector/connector-source-config.service.js +1 -1
  161. package/dist/src/data-marts/services/connector/connector-source-credentials.service.d.ts +6 -2
  162. package/dist/src/data-marts/services/connector/connector-source-credentials.service.js +18 -16
  163. package/dist/src/data-marts/services/connector/connector-specification.mapper.d.ts +47 -0
  164. package/dist/src/data-marts/services/connector/connector-specification.mapper.js +46 -0
  165. package/dist/src/data-marts/services/connector/connector-test.service.d.ts +43 -0
  166. package/dist/src/data-marts/services/connector/connector-test.service.js +343 -0
  167. package/dist/src/data-marts/services/connector/connector.service.d.ts +8 -2
  168. package/dist/src/data-marts/services/connector/connector.service.js +65 -54
  169. package/dist/src/data-marts/services/connector/declarative-manifest-schemas.d.ts +4 -0
  170. package/dist/src/data-marts/services/connector/declarative-manifest-schemas.js +48 -0
  171. package/dist/src/data-marts/services/connector/run-log-flusher.d.ts +21 -0
  172. package/dist/src/data-marts/services/connector/run-log-flusher.js +67 -0
  173. package/dist/src/data-marts/services/data-mart.service.js +2 -0
  174. package/dist/src/data-marts/services/report-sql-composer.service.js +15 -1
  175. package/dist/src/data-marts/services/report.service.d.ts +1 -0
  176. package/dist/src/data-marts/services/report.service.js +13 -0
  177. package/dist/src/data-marts/services/scheduled-trigger.service.d.ts +1 -0
  178. package/dist/src/data-marts/services/scheduled-trigger.service.js +13 -0
  179. package/dist/src/data-marts/use-cases/create-data-mart.service.js +1 -0
  180. package/dist/src/data-marts/use-cases/create-report.service.js +2 -0
  181. package/dist/src/data-marts/use-cases/get-model-canvas-data-marts.service.d.ts +5 -1
  182. package/dist/src/data-marts/use-cases/get-model-canvas-data-marts.service.js +16 -3
  183. package/dist/src/data-marts/use-cases/list-project-scheduled-triggers.service.js +1 -1
  184. package/dist/src/data-marts/use-cases/preview-data-mart.service.d.ts +59 -0
  185. package/dist/src/data-marts/use-cases/preview-data-mart.service.js +293 -0
  186. package/dist/src/data-marts/use-cases/stream-http-data.service.js +1 -0
  187. package/dist/src/data-marts/use-cases/update-data-mart-definition.service.d.ts +1 -1
  188. package/dist/src/data-marts/use-cases/update-data-mart-definition.service.js +8 -6
  189. package/dist/src/data-marts/use-cases/update-data-mart-icon.service.d.ts +12 -0
  190. package/dist/src/data-marts/use-cases/update-data-mart-icon.service.js +46 -0
  191. package/dist/src/data-marts/use-cases/update-data-mart-schema.service.js +14 -1
  192. package/dist/src/data-marts/use-cases/update-report.service.js +9 -1
  193. package/dist/src/ee/ee.module.js +5 -8
  194. package/dist/src/ee/mcp/auth/mcp-auth-context.d.ts +0 -4
  195. package/dist/src/ee/mcp/auth/mcp-auth.middleware.d.ts +26 -0
  196. package/dist/src/ee/mcp/auth/mcp-auth.middleware.js +184 -0
  197. package/dist/src/ee/mcp/http-headers.util.d.ts +2 -0
  198. package/dist/src/ee/mcp/http-headers.util.js +8 -0
  199. package/dist/src/ee/mcp/observability/mcp-bus-wiring.js +4 -4
  200. package/dist/src/ee/mcp/observability/mcp-call-instrumentation.d.ts +2 -4
  201. package/dist/src/ee/mcp/observability/mcp-call-instrumentation.js +6 -6
  202. package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.d.ts +1 -1
  203. package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.js +5 -5
  204. package/dist/src/ee/mcp/tools/add-destination.tool.d.ts +20 -14
  205. package/dist/src/ee/mcp/tools/add-destination.tool.js +10 -10
  206. package/dist/src/ee/mcp/tools/add-report.tool.d.ts +88 -228
  207. package/dist/src/ee/mcp/tools/add-report.tool.js +28 -28
  208. package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.d.ts +2 -12
  209. package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.js +13 -13
  210. package/dist/src/ee/mcp/tools/data-mart-catalog.tool.d.ts +15 -81
  211. package/dist/src/ee/mcp/tools/data-mart-catalog.tool.js +11 -11
  212. package/dist/src/ee/mcp/tools/data-mart-details.tool.d.ts +19 -111
  213. package/dist/src/ee/mcp/tools/data-mart-details.tool.js +64 -48
  214. package/dist/src/ee/mcp/tools/delete-report-run-schedule.tool.d.ts +2 -6
  215. package/dist/src/ee/mcp/tools/delete-report-run-schedule.tool.js +7 -7
  216. package/dist/src/ee/mcp/tools/delete-report.tool.d.ts +2 -6
  217. package/dist/src/ee/mcp/tools/delete-report.tool.js +4 -4
  218. package/dist/src/ee/mcp/tools/get-data-mart-reports.tool.d.ts +30 -195
  219. package/dist/src/ee/mcp/tools/get-data-mart-reports.tool.js +22 -22
  220. package/dist/src/ee/mcp/tools/get-report-output-schema.tool.d.ts +3 -21
  221. package/dist/src/ee/mcp/tools/get-report-output-schema.tool.js +10 -10
  222. package/dist/src/ee/mcp/tools/get-report-run-status.tool.d.ts +15 -11
  223. package/dist/src/ee/mcp/tools/get-report-run-status.tool.js +14 -14
  224. package/dist/src/ee/mcp/tools/list-destinations.tool.d.ts +12 -20
  225. package/dist/src/ee/mcp/tools/list-destinations.tool.js +10 -10
  226. package/dist/src/ee/mcp/tools/list-report-run-schedules.tool.d.ts +5 -61
  227. package/dist/src/ee/mcp/tools/list-report-run-schedules.tool.js +14 -14
  228. package/dist/src/ee/mcp/tools/mcp-getting-started.util.d.ts +4 -52
  229. package/dist/src/ee/mcp/tools/mcp-getting-started.util.js +13 -13
  230. package/dist/src/ee/mcp/tools/mcp-tool.definition.d.ts +2 -2
  231. package/dist/src/ee/mcp/tools/project-context.tool.d.ts +3 -17
  232. package/dist/src/ee/mcp/tools/project-context.tool.js +10 -10
  233. package/dist/src/ee/mcp/tools/query-data-mart.input.d.ts +111 -152
  234. package/dist/src/ee/mcp/tools/query-data-mart.input.js +39 -39
  235. package/dist/src/ee/mcp/tools/query-data-mart.tool.d.ts +60 -130
  236. package/dist/src/ee/mcp/tools/query-data-mart.tool.js +35 -35
  237. package/dist/src/ee/mcp/tools/report-output-controls-output.d.ts +17 -60
  238. package/dist/src/ee/mcp/tools/report-output-controls-output.js +20 -20
  239. package/dist/src/ee/mcp/tools/report-run-outcome.d.ts +6 -42
  240. package/dist/src/ee/mcp/tools/report-run-outcome.js +20 -20
  241. package/dist/src/ee/mcp/tools/run-report.tool.d.ts +2 -6
  242. package/dist/src/ee/mcp/tools/run-report.tool.js +5 -5
  243. package/dist/src/ee/mcp/tools/search-data-marts.tool.d.ts +7 -79
  244. package/dist/src/ee/mcp/tools/search-data-marts.tool.js +11 -11
  245. package/dist/src/ee/mcp/tools/search-reports.tool.d.ts +15 -61
  246. package/dist/src/ee/mcp/tools/search-reports.tool.js +15 -15
  247. package/dist/src/ee/mcp/tools/summarize-data-catalog.tool.d.ts +7 -79
  248. package/dist/src/ee/mcp/tools/summarize-data-catalog.tool.js +15 -15
  249. package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.d.ts +2 -12
  250. package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.js +13 -13
  251. package/dist/src/ee/mcp/tools/update-report.tool.d.ts +105 -414
  252. package/dist/src/ee/mcp/tools/update-report.tool.js +20 -20
  253. package/dist/src/ee/mcp/transport/mcp-http-entry.service.d.ts +30 -0
  254. package/dist/src/ee/mcp/transport/mcp-http-entry.service.js +193 -0
  255. package/dist/src/idp/guards/idp.guard.js +2 -8
  256. package/dist/src/idp/oauth/controllers/oauth-authorization.controller.d.ts +4 -0
  257. package/dist/src/idp/oauth/controllers/oauth-authorization.controller.js +77 -1
  258. package/dist/src/idp/oauth/controllers/oauth-metadata.controller.d.ts +2 -1
  259. package/dist/src/idp/oauth/controllers/oauth-metadata.controller.js +5 -8
  260. package/dist/src/idp/oauth/controllers/oauth-token.controller.js +14 -1
  261. package/dist/src/idp/oauth/oauth-request.validator.d.ts +8 -0
  262. package/dist/src/idp/oauth/oauth-request.validator.js +27 -0
  263. package/dist/src/idp/utils/is-authentication-error.d.ts +1 -0
  264. package/dist/src/idp/utils/is-authentication-error.js +9 -0
  265. package/dist/src/idp/utils/role-hierarchy.d.ts +3 -0
  266. package/dist/src/idp/utils/role-hierarchy.js +14 -0
  267. package/dist/src/index.d.ts +1 -0
  268. package/dist/src/index.js +3 -1
  269. package/dist/src/migrations/1788048000000-create-connector-definition-tables.d.ts +6 -0
  270. package/dist/src/migrations/1788048000000-create-connector-definition-tables.js +116 -0
  271. package/dist/src/migrations/1790156789783-add-auto-aggregation-opt-out-to-report.d.ts +8 -0
  272. package/dist/src/migrations/1790156789783-add-auto-aggregation-opt-out-to-report.js +30 -0
  273. package/dist/src/migrations/1790247861000-add-icon-to-data-mart.d.ts +8 -0
  274. package/dist/src/migrations/1790247861000-add-icon-to-data-mart.js +31 -0
  275. package/package.json +10 -6
  276. package/dist/src/ee/mcp/auth/mcp-auth.exception-filter.d.ts +0 -14
  277. package/dist/src/ee/mcp/auth/mcp-auth.exception-filter.js +0 -84
  278. package/dist/src/ee/mcp/auth/mcp-auth.guard.d.ts +0 -14
  279. package/dist/src/ee/mcp/auth/mcp-auth.guard.js +0 -99
  280. package/dist/src/ee/mcp/controllers/mcp-transport.controller.d.ts +0 -17
  281. package/dist/src/ee/mcp/controllers/mcp-transport.controller.js +0 -134
  282. package/dist/src/ee/mcp/sdk/mcp-streamable-http-transport.handler.d.ts +0 -16
  283. package/dist/src/ee/mcp/sdk/mcp-streamable-http-transport.handler.js +0 -133
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.GetProjectContextTool = void 0;
17
17
  const internal_helpers_1 = require("@owox/internal-helpers");
18
18
  const common_1 = require("@nestjs/common");
19
- const zod_1 = require("zod");
19
+ const zod_v4_1 = require("zod-v4");
20
20
  const mcp_project_context_facade_1 = require("../../../idp/facades/mcp-project-context.facade");
21
21
  const project_settings_facade_1 = require("../../../project-settings/facades/project-settings.facade");
22
22
  const mcp_tool_definition_1 = require("./mcp-tool.definition");
@@ -28,15 +28,15 @@ let GetProjectContextTool = GetProjectContextTool_1 = class GetProjectContextToo
28
28
  description = 'Returns the current OWOX project selected for this MCP connection, including its complete admin-maintained project description, id, title, roles, status, and creation date. Call this tool before the first project-specific operation in a conversation and when the user asks which project is current, active, selected, or connected. If the user asks how to change or switch projects, explain that project selection happens during OWOX authorization: disconnect and reconnect this MCP server, then sign in again and choose the desired project.';
29
29
  zodSchema = {};
30
30
  outputSchema = {
31
- current_project: zod_1.z.object({
32
- id: zod_1.z.string(),
33
- title: zod_1.z.string(),
34
- description: zod_1.z.string().nullable(),
35
- status: zod_1.z.string(),
36
- roles: zod_1.z.array(zod_1.z.string()),
37
- created_at: zod_1.z.string(),
31
+ current_project: zod_v4_1.z.object({
32
+ id: zod_v4_1.z.string(),
33
+ title: zod_v4_1.z.string(),
34
+ description: zod_v4_1.z.string().nullable(),
35
+ status: zod_v4_1.z.string(),
36
+ roles: zod_v4_1.z.array(zod_v4_1.z.string()),
37
+ created_at: zod_v4_1.z.string(),
38
38
  }),
39
- project_switching: zod_1.z.string(),
39
+ project_switching: zod_v4_1.z.string(),
40
40
  };
41
41
  annotations = {
42
42
  title: 'Get Project Context',
@@ -45,7 +45,7 @@ let GetProjectContextTool = GetProjectContextTool_1 = class GetProjectContextToo
45
45
  openWorldHint: false,
46
46
  };
47
47
  requiredScopes = ['mcp:read'];
48
- inputSchema = zod_1.z.object({}).strict();
48
+ inputSchema = zod_v4_1.z.object({}).strict();
49
49
  constructor(projectContext, projectSettings) {
50
50
  this.projectContext = projectContext;
51
51
  this.projectSettings = projectSettings;
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod-v4';
2
2
  import { type FilterConfig } from '../../../data-marts/dto/schemas/filter-config.schema';
3
3
  import type { AggregationConfig } from '../../../data-marts/dto/schemas/aggregation-config.schema';
4
4
  import type { DateTruncConfig } from '../../../data-marts/dto/schemas/date-trunc-config.schema';
@@ -8,187 +8,146 @@ declare const MAX_LIMIT = 1000;
8
8
  declare const DEFAULT_LIMIT = 20;
9
9
  declare const MCP_OPERATORS: readonly ["eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "in", "not_in", "gt", "gte", "lt", "lte", "between", "is_blank", "is_not_blank", "is_empty", "is_not_empty", "is_null", "is_not_null", "before", "after", "in_last_n_days", "in_next_n_days", "this_week", "last_week", "this_month", "this_quarter", "last_quarter", "this_year"];
10
10
  export declare const LEGACY_MCP_OPERATORS: readonly ["is_empty", "is_not_empty", "is_null", "is_not_null"];
11
- export declare const McpOperatorEnum: z.ZodEnum<["eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "in", "not_in", "gt", "gte", "lt", "lte", "between", "is_blank", "is_not_blank", "is_empty", "is_not_empty", "is_null", "is_not_null", "before", "after", "in_last_n_days", "in_next_n_days", "this_week", "last_week", "this_month", "this_quarter", "last_quarter", "this_year"]>;
11
+ export declare const McpOperatorEnum: z.ZodEnum<{
12
+ between: "between";
13
+ in: "in";
14
+ this_week: "this_week";
15
+ last_week: "last_week";
16
+ this_month: "this_month";
17
+ this_quarter: "this_quarter";
18
+ last_quarter: "last_quarter";
19
+ this_year: "this_year";
20
+ eq: "eq";
21
+ neq: "neq";
22
+ contains: "contains";
23
+ not_contains: "not_contains";
24
+ starts_with: "starts_with";
25
+ ends_with: "ends_with";
26
+ gt: "gt";
27
+ lt: "lt";
28
+ gte: "gte";
29
+ lte: "lte";
30
+ is_blank: "is_blank";
31
+ is_not_blank: "is_not_blank";
32
+ is_empty: "is_empty";
33
+ is_not_empty: "is_not_empty";
34
+ is_null: "is_null";
35
+ is_not_null: "is_not_null";
36
+ not_in: "not_in";
37
+ in_last_n_days: "in_last_n_days";
38
+ in_next_n_days: "in_next_n_days";
39
+ before: "before";
40
+ after: "after";
41
+ }>;
12
42
  type McpOperator = (typeof MCP_OPERATORS)[number];
13
43
  export declare const ADVERTISED_MCP_OPERATORS: readonly [McpOperator, ...McpOperator[]];
14
44
  export declare const makeMcpFilterSchema: () => z.ZodObject<{
15
45
  field: z.ZodString;
16
- operator: z.ZodEffects<z.ZodCatch<z.ZodEnum<["between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", ...("between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after")[]]>>, "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown>;
17
- value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
18
- }, "strip", z.ZodTypeAny, {
19
- operator: "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after";
20
- field: string;
21
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
22
- }, {
23
- field: string;
24
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
25
- operator?: unknown;
26
- }>;
46
+ operator: z.ZodType<"between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown, z.core.$ZodTypeInternals<"between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown>>;
47
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
48
+ }, z.core.$strip>;
27
49
  export declare const MCP_AGGREGATE_FUNCTIONS: readonly ["SUM", "COUNT", "COUNT_DISTINCT", "AVG", "MIN", "MAX", "P25", "P50", "P75", "P95"];
28
50
  export declare const makeMcpAggregationSchema: () => z.ZodObject<{
29
51
  field: z.ZodString;
30
- function: z.ZodEnum<["SUM", "COUNT", "COUNT_DISTINCT", "AVG", "MIN", "MAX", "P25", "P50", "P75", "P95"]>;
31
- }, "strip", z.ZodTypeAny, {
32
- function: "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "P25" | "P50" | "P75" | "P95";
33
- field: string;
34
- }, {
35
- function: "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "P25" | "P50" | "P75" | "P95";
36
- field: string;
37
- }>;
52
+ function: z.ZodEnum<{
53
+ MAX: "MAX";
54
+ MIN: "MIN";
55
+ SUM: "SUM";
56
+ AVG: "AVG";
57
+ COUNT: "COUNT";
58
+ COUNT_DISTINCT: "COUNT_DISTINCT";
59
+ P25: "P25";
60
+ P50: "P50";
61
+ P75: "P75";
62
+ P95: "P95";
63
+ }>;
64
+ }, z.core.$strip>;
38
65
  export declare const makeMcpReportAggregationSchema: () => z.ZodObject<{
39
66
  field: z.ZodString;
40
- function: z.ZodEnum<["STRING_AGG", "MAX", "MIN", "SUM", "AVG", "COUNT", "COUNT_DISTINCT", "ANY_VALUE", "P25", "P50", "P75", "P95"]>;
41
- }, "strip", z.ZodTypeAny, {
42
- function: "STRING_AGG" | "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "ANY_VALUE" | "P25" | "P50" | "P75" | "P95";
43
- field: string;
44
- }, {
45
- function: "STRING_AGG" | "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "ANY_VALUE" | "P25" | "P50" | "P75" | "P95";
46
- field: string;
47
- }>;
67
+ function: z.ZodEnum<{
68
+ STRING_AGG: "STRING_AGG";
69
+ MAX: "MAX";
70
+ MIN: "MIN";
71
+ SUM: "SUM";
72
+ AVG: "AVG";
73
+ COUNT: "COUNT";
74
+ COUNT_DISTINCT: "COUNT_DISTINCT";
75
+ ANY_VALUE: "ANY_VALUE";
76
+ P25: "P25";
77
+ P50: "P50";
78
+ P75: "P75";
79
+ P95: "P95";
80
+ }>;
81
+ }, z.core.$strip>;
48
82
  export declare const makeMcpDateBucketSchema: () => z.ZodObject<{
49
83
  field: z.ZodString;
50
- unit: z.ZodEnum<["DAY", "WEEK", "MONTH", "QUARTER", "YEAR"]>;
84
+ unit: z.ZodEnum<{
85
+ DAY: "DAY";
86
+ WEEK: "WEEK";
87
+ MONTH: "MONTH";
88
+ QUARTER: "QUARTER";
89
+ YEAR: "YEAR";
90
+ }>;
51
91
  time_zone: z.ZodOptional<z.ZodString>;
52
- }, "strip", z.ZodTypeAny, {
53
- unit: "DAY" | "WEEK" | "MONTH" | "QUARTER" | "YEAR";
54
- field: string;
55
- time_zone?: string | undefined;
56
- }, {
57
- unit: "DAY" | "WEEK" | "MONTH" | "QUARTER" | "YEAR";
58
- field: string;
59
- time_zone?: string | undefined;
60
- }>;
92
+ }, z.core.$strip>;
61
93
  export declare const makeMcpSortSchema: () => z.ZodObject<{
62
94
  field: z.ZodString;
63
- direction: z.ZodEnum<["asc", "desc"]>;
64
- }, "strip", z.ZodTypeAny, {
65
- direction: "asc" | "desc";
66
- field: string;
67
- }, {
68
- direction: "asc" | "desc";
69
- field: string;
70
- }>;
95
+ direction: z.ZodEnum<{
96
+ asc: "asc";
97
+ desc: "desc";
98
+ }>;
99
+ }, z.core.$strip>;
71
100
  export declare const queryDataMartInputSchema: z.ZodObject<{
72
101
  data_mart_id: z.ZodString;
73
- fields: z.ZodArray<z.ZodString, "many">;
102
+ fields: z.ZodArray<z.ZodString>;
74
103
  slices: z.ZodOptional<z.ZodArray<z.ZodObject<{
75
104
  field: z.ZodString;
76
- operator: z.ZodEffects<z.ZodCatch<z.ZodEnum<["between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", ...("between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after")[]]>>, "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown>;
77
- value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
78
- }, "strip", z.ZodTypeAny, {
79
- operator: "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after";
80
- field: string;
81
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
82
- }, {
83
- field: string;
84
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
85
- operator?: unknown;
86
- }>, "many">>;
105
+ operator: z.ZodType<"between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown, z.core.$ZodTypeInternals<"between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown>>;
106
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
107
+ }, z.core.$strip>>>;
87
108
  filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
109
  field: z.ZodString;
89
- operator: z.ZodEffects<z.ZodCatch<z.ZodEnum<["between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", ...("between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after")[]]>>, "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown>;
90
- value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
91
- }, "strip", z.ZodTypeAny, {
92
- operator: "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after";
93
- field: string;
94
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
95
- }, {
96
- field: string;
97
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
98
- operator?: unknown;
99
- }>, "many">>;
110
+ operator: z.ZodType<"between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown, z.core.$ZodTypeInternals<"between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after", unknown>>;
111
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
112
+ }, z.core.$strip>>>;
100
113
  aggregations: z.ZodOptional<z.ZodArray<z.ZodObject<{
101
114
  field: z.ZodString;
102
- function: z.ZodEnum<["SUM", "COUNT", "COUNT_DISTINCT", "AVG", "MIN", "MAX", "P25", "P50", "P75", "P95"]>;
103
- }, "strip", z.ZodTypeAny, {
104
- function: "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "P25" | "P50" | "P75" | "P95";
105
- field: string;
106
- }, {
107
- function: "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "P25" | "P50" | "P75" | "P95";
108
- field: string;
109
- }>, "many">>;
115
+ function: z.ZodEnum<{
116
+ MAX: "MAX";
117
+ MIN: "MIN";
118
+ SUM: "SUM";
119
+ AVG: "AVG";
120
+ COUNT: "COUNT";
121
+ COUNT_DISTINCT: "COUNT_DISTINCT";
122
+ P25: "P25";
123
+ P50: "P50";
124
+ P75: "P75";
125
+ P95: "P95";
126
+ }>;
127
+ }, z.core.$strip>>>;
110
128
  date_buckets: z.ZodOptional<z.ZodArray<z.ZodObject<{
111
129
  field: z.ZodString;
112
- unit: z.ZodEnum<["DAY", "WEEK", "MONTH", "QUARTER", "YEAR"]>;
130
+ unit: z.ZodEnum<{
131
+ DAY: "DAY";
132
+ WEEK: "WEEK";
133
+ MONTH: "MONTH";
134
+ QUARTER: "QUARTER";
135
+ YEAR: "YEAR";
136
+ }>;
113
137
  time_zone: z.ZodOptional<z.ZodString>;
114
- }, "strip", z.ZodTypeAny, {
115
- unit: "DAY" | "WEEK" | "MONTH" | "QUARTER" | "YEAR";
116
- field: string;
117
- time_zone?: string | undefined;
118
- }, {
119
- unit: "DAY" | "WEEK" | "MONTH" | "QUARTER" | "YEAR";
120
- field: string;
121
- time_zone?: string | undefined;
122
- }>, "many">>;
138
+ }, z.core.$strip>>>;
123
139
  sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
140
  field: z.ZodString;
125
- direction: z.ZodEnum<["asc", "desc"]>;
126
- }, "strip", z.ZodTypeAny, {
127
- direction: "asc" | "desc";
128
- field: string;
129
- }, {
130
- direction: "asc" | "desc";
131
- field: string;
132
- }>, "many">>;
141
+ direction: z.ZodEnum<{
142
+ asc: "asc";
143
+ desc: "desc";
144
+ }>;
145
+ }, z.core.$strip>>>;
133
146
  limit: z.ZodOptional<z.ZodNumber>;
134
- }, "strict", z.ZodTypeAny, {
135
- fields: string[];
136
- data_mart_id: string;
137
- sort?: {
138
- direction: "asc" | "desc";
139
- field: string;
140
- }[] | undefined;
141
- limit?: number | undefined;
142
- filters?: {
143
- operator: "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after";
144
- field: string;
145
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
146
- }[] | undefined;
147
- aggregations?: {
148
- function: "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "P25" | "P50" | "P75" | "P95";
149
- field: string;
150
- }[] | undefined;
151
- slices?: {
152
- operator: "between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after";
153
- field: string;
154
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
155
- }[] | undefined;
156
- date_buckets?: {
157
- unit: "DAY" | "WEEK" | "MONTH" | "QUARTER" | "YEAR";
158
- field: string;
159
- time_zone?: string | undefined;
160
- }[] | undefined;
161
- }, {
162
- fields: string[];
163
- data_mart_id: string;
164
- sort?: {
165
- direction: "asc" | "desc";
166
- field: string;
167
- }[] | undefined;
168
- limit?: number | undefined;
169
- filters?: {
170
- field: string;
171
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
172
- operator?: unknown;
173
- }[] | undefined;
174
- aggregations?: {
175
- function: "MAX" | "MIN" | "SUM" | "AVG" | "COUNT" | "COUNT_DISTINCT" | "P25" | "P50" | "P75" | "P95";
176
- field: string;
177
- }[] | undefined;
178
- slices?: {
179
- field: string;
180
- value?: string | number | boolean | unknown[] | Record<string, unknown> | null | undefined;
181
- operator?: unknown;
182
- }[] | undefined;
183
- date_buckets?: {
184
- unit: "DAY" | "WEEK" | "MONTH" | "QUARTER" | "YEAR";
185
- field: string;
186
- time_zone?: string | undefined;
187
- }[] | undefined;
188
- }>;
147
+ }, z.core.$strict>;
189
148
  export type QueryDataMartInput = z.infer<typeof queryDataMartInputSchema>;
190
149
  export { DEFAULT_LIMIT, MAX_LIMIT };
191
- export declare const SUPPORTED_MCP_OPERATORS: ["eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "in", "not_in", "gt", "gte", "lt", "lte", "between", "is_blank", "is_not_blank", "is_empty", "is_not_empty", "is_null", "is_not_null", "before", "after", "in_last_n_days", "in_next_n_days", "this_week", "last_week", "this_month", "this_quarter", "last_quarter", "this_year"];
150
+ export declare const SUPPORTED_MCP_OPERATORS: ("between" | "in" | "this_week" | "last_week" | "this_month" | "this_quarter" | "last_quarter" | "this_year" | "eq" | "neq" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "lt" | "gte" | "lte" | "is_blank" | "is_not_blank" | "is_empty" | "is_not_empty" | "is_null" | "is_not_null" | "not_in" | "in_last_n_days" | "in_next_n_days" | "before" | "after")[];
192
151
  export declare const BOOLEAN_MCP_OPERATORS: readonly ["eq", "neq", "is_blank", "is_not_blank"];
193
152
  export declare class UnsupportedOperatorError extends Error {
194
153
  readonly operator: string;
@@ -10,7 +10,7 @@ exports.hasUniqueCountFieldCandidate = hasUniqueCountFieldCandidate;
10
10
  exports.collectRealFieldNames = collectRealFieldNames;
11
11
  exports.splitUniqueCountFields = splitUniqueCountFields;
12
12
  exports.findUniqueCountClauseViolations = findUniqueCountClauseViolations;
13
- const zod_1 = require("zod");
13
+ const zod_v4_1 = require("zod-v4");
14
14
  const filter_config_schema_1 = require("../../../data-marts/dto/schemas/filter-config.schema");
15
15
  const aggregate_function_schema_1 = require("../../../data-marts/dto/schemas/aggregate-function.schema");
16
16
  const date_trunc_config_schema_1 = require("../../../data-marts/dto/schemas/date-trunc-config.schema");
@@ -53,34 +53,34 @@ const MCP_OPERATORS = [
53
53
  'this_year',
54
54
  ];
55
55
  exports.LEGACY_MCP_OPERATORS = ['is_empty', 'is_not_empty', 'is_null', 'is_not_null'];
56
- exports.McpOperatorEnum = zod_1.z.enum(MCP_OPERATORS);
56
+ exports.McpOperatorEnum = zod_v4_1.z.enum(MCP_OPERATORS);
57
57
  exports.ADVERTISED_MCP_OPERATORS = MCP_OPERATORS.filter(op => !exports.LEGACY_MCP_OPERATORS.includes(op));
58
- const makeMcpOperatorSchema = () => zod_1.z
59
- .enum(exports.ADVERTISED_MCP_OPERATORS)
60
- .catch(ctx => ctx.input)
58
+ const makeMcpOperatorSchema = () => zod_v4_1.z
59
+ .any()
60
+ .meta({ enum: exports.ADVERTISED_MCP_OPERATORS })
61
61
  .superRefine((op, ctx) => {
62
62
  if (op === undefined || op === null) {
63
- ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: 'operator is required' });
63
+ ctx.addIssue({ code: zod_v4_1.z.ZodIssueCode.custom, message: 'operator is required' });
64
64
  return;
65
65
  }
66
66
  if (!exports.SUPPORTED_MCP_OPERATORS.includes(op)) {
67
67
  ctx.addIssue({
68
- code: zod_1.z.ZodIssueCode.custom,
68
+ code: zod_v4_1.z.ZodIssueCode.custom,
69
69
  message: unsupportedOperatorMessage(String(op)),
70
70
  });
71
71
  }
72
72
  });
73
- const makeMcpFilterSchema = () => zod_1.z.object({
74
- field: zod_1.z.string().min(1),
73
+ const makeMcpFilterSchema = () => zod_v4_1.z.object({
74
+ field: zod_v4_1.z.string().min(1),
75
75
  operator: makeMcpOperatorSchema(),
76
- value: zod_1.z
76
+ value: zod_v4_1.z
77
77
  .union([
78
- zod_1.z.string(),
79
- zod_1.z.number(),
80
- zod_1.z.boolean(),
81
- zod_1.z.array(zod_1.z.unknown()),
82
- zod_1.z.record(zod_1.z.unknown()),
83
- zod_1.z.null(),
78
+ zod_v4_1.z.string(),
79
+ zod_v4_1.z.number(),
80
+ zod_v4_1.z.boolean(),
81
+ zod_v4_1.z.array(zod_v4_1.z.unknown()),
82
+ zod_v4_1.z.record(zod_v4_1.z.string(), zod_v4_1.z.unknown()),
83
+ zod_v4_1.z.null(),
84
84
  ])
85
85
  .optional()
86
86
  .describe('Operand for the operator: scalar for comparisons; {from, to} for between; array of scalars for in/not_in; positive integer for in_last_n_days/in_next_n_days; omit for is_blank/is_not_blank and the this_/last_ calendar presets.'),
@@ -98,58 +98,58 @@ exports.MCP_AGGREGATE_FUNCTIONS = [
98
98
  'P75',
99
99
  'P95',
100
100
  ];
101
- const makeMcpAggregationSchema = () => zod_1.z.object({
102
- field: zod_1.z.string().min(1),
103
- function: zod_1.z.enum(exports.MCP_AGGREGATE_FUNCTIONS),
101
+ const makeMcpAggregationSchema = () => zod_v4_1.z.object({
102
+ field: zod_v4_1.z.string().min(1),
103
+ function: zod_v4_1.z.enum(exports.MCP_AGGREGATE_FUNCTIONS),
104
104
  });
105
105
  exports.makeMcpAggregationSchema = makeMcpAggregationSchema;
106
- const makeMcpReportAggregationSchema = () => zod_1.z.object({
107
- field: zod_1.z.string().min(1),
108
- function: zod_1.z.enum(aggregate_function_schema_1.REPORT_AGGREGATE_FUNCTIONS),
106
+ const makeMcpReportAggregationSchema = () => zod_v4_1.z.object({
107
+ field: zod_v4_1.z.string().min(1),
108
+ function: zod_v4_1.z.enum(aggregate_function_schema_1.REPORT_AGGREGATE_FUNCTIONS),
109
109
  });
110
110
  exports.makeMcpReportAggregationSchema = makeMcpReportAggregationSchema;
111
- const makeMcpDateBucketSchema = () => zod_1.z.object({
112
- field: zod_1.z.string().min(1),
113
- unit: zod_1.z.enum(date_trunc_config_schema_1.DATE_TRUNC_UNITS),
114
- time_zone: zod_1.z.string().min(1).regex(date_trunc_config_schema_1.IANA_TIME_ZONE_PATTERN, 'Invalid IANA time zone').optional(),
111
+ const makeMcpDateBucketSchema = () => zod_v4_1.z.object({
112
+ field: zod_v4_1.z.string().min(1),
113
+ unit: zod_v4_1.z.enum(date_trunc_config_schema_1.DATE_TRUNC_UNITS),
114
+ time_zone: zod_v4_1.z.string().min(1).regex(date_trunc_config_schema_1.IANA_TIME_ZONE_PATTERN, 'Invalid IANA time zone').optional(),
115
115
  });
116
116
  exports.makeMcpDateBucketSchema = makeMcpDateBucketSchema;
117
- const makeMcpSortSchema = () => zod_1.z.object({
118
- field: zod_1.z.string().min(1),
119
- direction: zod_1.z.enum(['asc', 'desc']),
117
+ const makeMcpSortSchema = () => zod_v4_1.z.object({
118
+ field: zod_v4_1.z.string().min(1),
119
+ direction: zod_v4_1.z.enum(['asc', 'desc']),
120
120
  });
121
121
  exports.makeMcpSortSchema = makeMcpSortSchema;
122
- exports.queryDataMartInputSchema = zod_1.z
122
+ exports.queryDataMartInputSchema = zod_v4_1.z
123
123
  .object({
124
- data_mart_id: zod_1.z
124
+ data_mart_id: zod_v4_1.z
125
125
  .string()
126
126
  .min(1)
127
127
  .describe('ID of the data mart to query (from list_data_marts or get_data_mart_details_by_id).'),
128
- fields: zod_1.z
129
- .array(zod_1.z.string().min(1))
128
+ fields: zod_v4_1.z
129
+ .array(zod_v4_1.z.string().min(1))
130
130
  .min(1)
131
131
  .describe('Exact field names to return, copied verbatim from get_data_mart_details_by_id. MUST include every field named in aggregations, date_buckets, and sort — a field you aggregate, bucket, or sort but omit here is rejected. Fields here that are neither aggregated nor bucketed become group-by dimensions.'),
132
- slices: zod_1.z
132
+ slices: zod_v4_1.z
133
133
  .array((0, exports.makeMcpFilterSchema)())
134
134
  .optional()
135
135
  .describe("Pre-join filters: narrow a JOINED data mart before it is blended in. Criteria on a joined data mart's own fields only — never the main data mart."),
136
- filters: zod_1.z
136
+ filters: zod_v4_1.z
137
137
  .array((0, exports.makeMcpFilterSchema)())
138
138
  .optional()
139
139
  .describe('Post-join filters on the blended result. May reference a field that is NOT in "fields" (e.g. filter on a column you do not display).'),
140
- aggregations: zod_1.z
140
+ aggregations: zod_v4_1.z
141
141
  .array((0, exports.makeMcpAggregationSchema)())
142
142
  .optional()
143
143
  .describe('Aggregations over a field. Each aggregated field must also appear in "fields".'),
144
- date_buckets: zod_1.z
144
+ date_buckets: zod_v4_1.z
145
145
  .array((0, exports.makeMcpDateBucketSchema)())
146
146
  .optional()
147
147
  .describe('Bucket a date/timestamp field by DAY/WEEK/MONTH/QUARTER/YEAR. Each bucketed field must also appear in "fields".'),
148
- sort: zod_1.z
148
+ sort: zod_v4_1.z
149
149
  .array((0, exports.makeMcpSortSchema)())
150
150
  .optional()
151
151
  .describe('Order the result rows. Each rule is { field, direction } with direction "asc" or "desc"; rules apply in order (the first is the primary key). Each sorted field must also appear in "fields".'),
152
- limit: zod_1.z
152
+ limit: zod_v4_1.z
153
153
  .number()
154
154
  .int()
155
155
  .min(1)