@owox/backend 0.35.0-next-20260917211534 → 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.
- package/dist/src/common/exceptions/concurrency-limit-exceeded.exception.d.ts +1 -1
- package/dist/src/common/exceptions/concurrency-limit-exceeded.exception.js +2 -2
- package/dist/src/common/markdown/markdown-parser.service.d.ts +2 -0
- package/dist/src/common/markdown/markdown-parser.service.js +15 -8
- package/dist/src/common/search/search.facade.d.ts +15 -1
- package/dist/src/common/search/search.facade.js +1 -0
- package/dist/src/common/validators/max-byte-length.validator.d.ts +2 -0
- package/dist/src/common/validators/max-byte-length.validator.js +29 -0
- package/dist/src/config/env-validation.config.d.ts +12 -0
- package/dist/src/config/env-validation.config.js +7 -0
- package/dist/src/data-marts/ai-insights/agent/types.d.ts +18 -18
- package/dist/src/data-marts/calculated-fields/calculated-field-validator.service.js +22 -30
- package/dist/src/data-marts/calculated-fields/calculated-field.utils.d.ts +1 -0
- package/dist/src/data-marts/calculated-fields/calculated-field.utils.js +21 -0
- package/dist/src/data-marts/calculated-fields/formula-analyzer.d.ts +1 -0
- package/dist/src/data-marts/calculated-fields/formula-analyzer.js +2 -0
- package/dist/src/data-marts/calculated-fields/formula-violations.d.ts +7 -0
- package/dist/src/data-marts/calculated-fields/formula-violations.js +82 -1
- package/dist/src/data-marts/calculated-fields/join-grain.d.ts +32 -0
- package/dist/src/data-marts/calculated-fields/join-grain.js +107 -0
- package/dist/src/data-marts/calculated-fields/set-quantifier.d.ts +8 -0
- package/dist/src/data-marts/calculated-fields/set-quantifier.js +12 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/connector-message.schema.d.ts +66 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/connector-message.schema.js +13 -1
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-credentials-update.schema.d.ts +3 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-credentials-update.schema.js +1 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-error.schema.d.ts +3 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-error.schema.js +1 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-log.schema.d.ts +12 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-log.schema.js +4 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-requested-date.schema.d.ts +3 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-requested-date.schema.js +1 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-state-update.schema.d.ts +16 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-state-update.schema.js +16 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-status.schema.d.ts +3 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-status.schema.js +1 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-warning.schema.d.ts +3 -0
- package/dist/src/data-marts/connector-types/connector-message/schemas/types/message-warning.schema.js +1 -0
- package/dist/src/data-marts/connector-types/connector-message/services/connector-event.translator.d.ts +10 -0
- package/dist/src/data-marts/connector-types/connector-message/services/connector-event.translator.js +138 -0
- package/dist/src/data-marts/connector-types/connector-message/services/connector-message-parser.service.d.ts +1 -3
- package/dist/src/data-marts/connector-types/connector-message/services/connector-message-parser.service.js +30 -34
- package/dist/src/data-marts/connector-types/connector-message/services/connector-output-capture.service.js +10 -12
- package/dist/src/data-marts/connector-types/connector-message/services/connector-state.service.js +3 -1
- package/dist/src/data-marts/connector-types/enums/connector-message-type-enum.d.ts +1 -0
- package/dist/src/data-marts/connector-types/enums/connector-message-type-enum.js +1 -0
- package/dist/src/data-marts/controllers/connector-definition.controller.d.ts +30 -0
- package/dist/src/data-marts/controllers/connector-definition.controller.js +252 -0
- package/dist/src/data-marts/controllers/data-mart-preview.controller.d.ts +10 -0
- package/dist/src/data-marts/controllers/data-mart-preview.controller.js +58 -0
- package/dist/src/data-marts/controllers/data-mart.controller.d.ts +5 -1
- package/dist/src/data-marts/controllers/data-mart.controller.js +25 -4
- package/dist/src/data-marts/controllers/insight-template.controller.js +4 -4
- package/dist/src/data-marts/controllers/insight.controller.js +5 -5
- package/dist/src/data-marts/controllers/project-data-mart-runs.controller.js +1 -1
- package/dist/src/data-marts/controllers/spec/connector-definition.api.d.ts +12 -0
- package/dist/src/data-marts/controllers/spec/connector-definition.api.js +179 -0
- package/dist/src/data-marts/controllers/spec/data-mart.api.d.ts +1 -0
- package/dist/src/data-marts/controllers/spec/data-mart.api.js +5 -0
- package/dist/src/data-marts/controllers/spec/report-openapi.d.ts +18 -0
- package/dist/src/data-marts/controllers/spec/report-openapi.js +3 -0
- package/dist/src/data-marts/controllers/spec/report.api.js +5 -1
- package/dist/src/data-marts/controllers/spec/search.api.js +2 -1
- package/dist/src/data-marts/data-destination-types/enums/data-destination-type.enum.d.ts +1 -0
- package/dist/src/data-marts/data-destination-types/enums/data-destination-type.enum.js +14 -0
- package/dist/src/data-marts/data-marts.module.js +23 -2
- package/dist/src/data-marts/data-storage-types/blending/metric-sleeve.planner.js +3 -12
- package/dist/src/data-marts/data-storage-types/data-mart-schema.utils.d.ts +2 -0
- package/dist/src/data-marts/data-storage-types/data-mart-schema.utils.js +34 -0
- package/dist/src/data-marts/dto/domain/blendable-schema.dto.d.ts +11 -0
- package/dist/src/data-marts/dto/domain/blendable-schema.dto.js +86 -1
- package/dist/src/data-marts/dto/domain/create-data-mart.command.d.ts +3 -1
- package/dist/src/data-marts/dto/domain/create-data-mart.command.js +3 -1
- package/dist/src/data-marts/dto/domain/create-report.command.d.ts +3 -1
- package/dist/src/data-marts/dto/domain/create-report.command.js +3 -1
- package/dist/src/data-marts/dto/domain/data-mart-list-item.dto.d.ts +3 -1
- package/dist/src/data-marts/dto/domain/data-mart-list-item.dto.js +3 -1
- package/dist/src/data-marts/dto/domain/data-mart.dto.d.ts +4 -1
- package/dist/src/data-marts/dto/domain/data-mart.dto.js +5 -1
- package/dist/src/data-marts/dto/domain/model-canvas.dto.d.ts +4 -0
- package/dist/src/data-marts/dto/domain/report-like-read-plan.d.ts +2 -0
- package/dist/src/data-marts/dto/domain/report.dto.d.ts +3 -1
- package/dist/src/data-marts/dto/domain/report.dto.js +3 -1
- package/dist/src/data-marts/dto/domain/update-data-mart-icon.command.d.ts +9 -0
- package/dist/src/data-marts/dto/domain/update-data-mart-icon.command.js +19 -0
- package/dist/src/data-marts/dto/domain/update-report.command.d.ts +3 -1
- package/dist/src/data-marts/dto/domain/update-report.command.js +3 -1
- package/dist/src/data-marts/dto/presentation/create-data-mart-request-api.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/create-data-mart-request-api.dto.js +13 -0
- package/dist/src/data-marts/dto/presentation/create-report-request-api.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/create-report-request-api.dto.js +10 -0
- package/dist/src/data-marts/dto/presentation/custom-connector-response.dto.d.ts +46 -0
- package/dist/src/data-marts/dto/presentation/custom-connector-response.dto.js +216 -0
- package/dist/src/data-marts/dto/presentation/custom-connector.dto.d.ts +27 -0
- package/dist/src/data-marts/dto/presentation/custom-connector.dto.js +159 -0
- package/dist/src/data-marts/dto/presentation/data-mart-list-item-response-api.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/data-mart-list-item-response-api.dto.js +10 -0
- package/dist/src/data-marts/dto/presentation/data-mart-response-api.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/data-mart-response-api.dto.js +10 -0
- package/dist/src/data-marts/dto/presentation/model-canvas-response-api.dto.d.ts +4 -0
- package/dist/src/data-marts/dto/presentation/model-canvas-response-api.dto.js +20 -0
- package/dist/src/data-marts/dto/presentation/preview-data-mart-request-api.dto.d.ts +7 -0
- package/dist/src/data-marts/dto/presentation/preview-data-mart-request-api.dto.js +56 -0
- package/dist/src/data-marts/dto/presentation/preview-data-mart-response-api.dto.d.ts +12 -0
- package/dist/src/data-marts/dto/presentation/preview-data-mart-response-api.dto.js +64 -0
- package/dist/src/data-marts/dto/presentation/report-response-api.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/report-response-api.dto.js +6 -0
- package/dist/src/data-marts/dto/presentation/run-data-mart-request-api.dto.js +71 -1
- package/dist/src/data-marts/dto/presentation/search-result-response-api.dto.d.ts +15 -0
- package/dist/src/data-marts/dto/presentation/search-result-response-api.dto.js +61 -1
- package/dist/src/data-marts/dto/presentation/update-data-mart-description-api.dto.js +3 -0
- package/dist/src/data-marts/dto/presentation/update-data-mart-icon-api.dto.d.ts +4 -0
- package/dist/src/data-marts/dto/presentation/update-data-mart-icon-api.dto.js +30 -0
- package/dist/src/data-marts/dto/presentation/update-report-request-api.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/update-report-request-api.dto.js +10 -0
- package/dist/src/data-marts/dto/schemas/auto-aggregation-opt-out.schema.d.ts +15 -0
- package/dist/src/data-marts/dto/schemas/auto-aggregation-opt-out.schema.js +29 -0
- package/dist/src/data-marts/dto/schemas/data-mart-run/data-mart-run.schema.d.ts +9 -0
- package/dist/src/data-marts/dto/schemas/data-mart-table-definitions/connector-definition.schema.d.ts +15 -0
- package/dist/src/data-marts/dto/schemas/data-mart-table-definitions/connector-definition.schema.js +1 -0
- package/dist/src/data-marts/dto/schemas/data-mart-table-definitions/data-mart-definition.schema.d.ts +7 -0
- package/dist/src/data-marts/dto/schemas/data-quality/data-quality-run.schema.d.ts +20 -0
- package/dist/src/data-marts/entities/connector-definition-version.entity.d.ts +16 -0
- package/dist/src/data-marts/entities/connector-definition-version.entity.js +78 -0
- package/dist/src/data-marts/entities/connector-definition.entity.d.ts +14 -0
- package/dist/src/data-marts/entities/connector-definition.entity.js +82 -0
- package/dist/src/data-marts/entities/data-mart.entity.d.ts +2 -0
- package/dist/src/data-marts/entities/data-mart.entity.js +5 -0
- package/dist/src/data-marts/entities/report.entity.d.ts +3 -0
- package/dist/src/data-marts/entities/report.entity.js +19 -1
- package/dist/src/data-marts/entities/search/report-search-index.entity.d.ts +10 -0
- package/dist/src/data-marts/entities/search/report-search-index.entity.js +62 -0
- package/dist/src/data-marts/entities/search/search-project-reindex-trigger.entity.d.ts +2 -0
- package/dist/src/data-marts/entities/search/search-project-reindex-trigger.entity.js +9 -1
- package/dist/src/data-marts/entities/search/search-reindex-trigger.entity.d.ts +9 -1
- package/dist/src/data-marts/entities/search/search-reindex-trigger.entity.js +14 -0
- package/dist/src/data-marts/enums/data-mart-icon.enum.d.ts +75 -0
- package/dist/src/data-marts/enums/data-mart-icon.enum.js +80 -0
- package/dist/src/data-marts/errors/connector-credential-boundary.error.d.ts +3 -0
- package/dist/src/data-marts/errors/connector-credential-boundary.error.js +14 -0
- package/dist/src/data-marts/errors/disconnected-report-columns.error.d.ts +1 -1
- package/dist/src/data-marts/errors/disconnected-report-columns.error.js +19 -6
- package/dist/src/data-marts/facades/mcp-data-marts.facade.d.ts +2 -0
- package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.d.ts +7 -1
- package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.js +70 -5
- package/dist/src/data-marts/mappers/connector-definition.mapper.d.ts +14 -0
- package/dist/src/data-marts/mappers/connector-definition.mapper.js +57 -0
- package/dist/src/data-marts/mappers/data-mart.mapper.d.ts +9 -6
- package/dist/src/data-marts/mappers/data-mart.mapper.js +44 -19
- package/dist/src/data-marts/mappers/insight-template.mapper.d.ts +1 -1
- package/dist/src/data-marts/mappers/insight-template.mapper.js +2 -2
- package/dist/src/data-marts/mappers/insight.mapper.d.ts +1 -1
- package/dist/src/data-marts/mappers/insight.mapper.js +2 -2
- package/dist/src/data-marts/mappers/model-canvas.mapper.d.ts +10 -2
- package/dist/src/data-marts/mappers/model-canvas.mapper.js +9 -3
- package/dist/src/data-marts/mappers/report.mapper.js +4 -3
- package/dist/src/data-marts/search/config/advanced-search.config.d.ts +1 -0
- package/dist/src/data-marts/search/config/advanced-search.config.js +2 -0
- package/dist/src/data-marts/search/engine/advanced-search.service.js +1 -0
- package/dist/src/data-marts/search/engine/in-memory-paginated.search.js +3 -1
- package/dist/src/data-marts/search/engine/search-query-builder.d.ts +2 -1
- package/dist/src/data-marts/search/engine/search-query-builder.js +2 -2
- package/dist/src/data-marts/search/engine/tokenizer.d.ts +2 -0
- package/dist/src/data-marts/search/engine/tokenizer.js +9 -0
- package/dist/src/data-marts/search/engine/vector-search.port.d.ts +2 -1
- package/dist/src/data-marts/search/indexing/document-builder.d.ts +2 -0
- package/dist/src/data-marts/search/indexing/document-builder.js +1 -0
- package/dist/src/data-marts/search/indexing/entity-scoring-descriptor.d.ts +2 -1
- package/dist/src/data-marts/search/indexing/search-indexer.service.d.ts +9 -1
- package/dist/src/data-marts/search/indexing/search-indexer.service.js +147 -7
- package/dist/src/data-marts/search/indexing/search-reindex-trigger-handler.service.d.ts +6 -2
- package/dist/src/data-marts/search/indexing/search-reindex-trigger-handler.service.js +34 -2
- package/dist/src/data-marts/search/schema/search-index.repository.d.ts +1 -0
- package/dist/src/data-marts/search/schema/search-index.repository.js +81 -13
- package/dist/src/data-marts/search/search.facade.impl.d.ts +4 -1
- package/dist/src/data-marts/search/search.facade.impl.js +18 -4
- package/dist/src/data-marts/search/search.module.js +13 -2
- package/dist/src/data-marts/search/sources/report.source.d.ts +23 -0
- package/dist/src/data-marts/search/sources/report.source.js +173 -0
- package/dist/src/data-marts/services/advanced-search-index-sync.service.d.ts +5 -2
- package/dist/src/data-marts/services/advanced-search-index-sync.service.js +24 -1
- package/dist/src/data-marts/services/auto-collapse.resolver.d.ts +7 -1
- package/dist/src/data-marts/services/auto-collapse.resolver.js +18 -0
- package/dist/src/data-marts/services/blendable-schema.service.d.ts +2 -0
- package/dist/src/data-marts/services/blendable-schema.service.js +74 -1
- package/dist/src/data-marts/services/blended-report-data.service.js +3 -3
- package/dist/src/data-marts/services/connector/connector-credential-injector.service.d.ts +1 -1
- package/dist/src/data-marts/services/connector/connector-credential-injector.service.js +15 -1
- package/dist/src/data-marts/services/connector/connector-definition.service.d.ts +59 -0
- package/dist/src/data-marts/services/connector/connector-definition.service.js +491 -0
- package/dist/src/data-marts/services/connector/connector-executor.service.d.ts +10 -1
- package/dist/src/data-marts/services/connector/connector-executor.service.js +235 -59
- package/dist/src/data-marts/services/connector/connector-fields-preview.service.js +1 -1
- package/dist/src/data-marts/services/connector/connector-message.utils.js +2 -2
- package/dist/src/data-marts/services/connector/connector-preview-credentials.service.js +1 -1
- package/dist/src/data-marts/services/connector/connector-preview-support.d.ts +1 -1
- package/dist/src/data-marts/services/connector/connector-preview-support.js +14 -21
- package/dist/src/data-marts/services/connector/connector-process-spawner.service.d.ts +11 -2
- package/dist/src/data-marts/services/connector/connector-process-spawner.service.js +88 -60
- package/dist/src/data-marts/services/connector/connector-run.service.d.ts +3 -1
- package/dist/src/data-marts/services/connector/connector-run.service.js +10 -4
- package/dist/src/data-marts/services/connector/connector-secret.service.d.ts +6 -3
- package/dist/src/data-marts/services/connector/connector-secret.service.js +77 -12
- package/dist/src/data-marts/services/connector/connector-source-config.service.js +3 -6
- package/dist/src/data-marts/services/connector/connector-source-credentials.service.d.ts +6 -2
- package/dist/src/data-marts/services/connector/connector-source-credentials.service.js +18 -16
- package/dist/src/data-marts/services/connector/connector-specification.mapper.d.ts +47 -0
- package/dist/src/data-marts/services/connector/connector-specification.mapper.js +46 -0
- package/dist/src/data-marts/services/connector/connector-test.service.d.ts +43 -0
- package/dist/src/data-marts/services/connector/connector-test.service.js +343 -0
- package/dist/src/data-marts/services/connector/connector.service.d.ts +8 -2
- package/dist/src/data-marts/services/connector/connector.service.js +65 -54
- package/dist/src/data-marts/services/connector/declarative-manifest-schemas.d.ts +4 -0
- package/dist/src/data-marts/services/connector/declarative-manifest-schemas.js +48 -0
- package/dist/src/data-marts/services/connector/run-log-flusher.d.ts +21 -0
- package/dist/src/data-marts/services/connector/run-log-flusher.js +67 -0
- package/dist/src/data-marts/services/data-mart-run.service.d.ts +2 -0
- package/dist/src/data-marts/services/data-mart-run.service.js +6 -3
- package/dist/src/data-marts/services/data-mart.service.js +2 -0
- package/dist/src/data-marts/services/looker-studio-report.service.d.ts +7 -0
- package/dist/src/data-marts/services/looker-studio-report.service.js +79 -0
- package/dist/src/data-marts/services/output-controls-validator.service.js +1 -1
- package/dist/src/data-marts/services/report-data-cache.service.d.ts +1 -0
- package/dist/src/data-marts/services/report-data-cache.service.js +33 -8
- package/dist/src/data-marts/services/report-run.service.js +1 -1
- package/dist/src/data-marts/services/report-sql-composer.service.js +15 -1
- package/dist/src/data-marts/services/report.service.d.ts +7 -2
- package/dist/src/data-marts/services/report.service.js +30 -4
- package/dist/src/data-marts/services/scheduled-trigger.service.d.ts +1 -0
- package/dist/src/data-marts/services/scheduled-trigger.service.js +13 -0
- package/dist/src/data-marts/use-cases/create-data-mart.service.js +1 -0
- package/dist/src/data-marts/use-cases/create-report.service.d.ts +5 -1
- package/dist/src/data-marts/use-cases/create-report.service.js +23 -8
- package/dist/src/data-marts/use-cases/delete-report.service.d.ts +3 -1
- package/dist/src/data-marts/use-cases/delete-report.service.js +9 -3
- package/dist/src/data-marts/use-cases/get-model-canvas-data-marts.service.d.ts +5 -1
- package/dist/src/data-marts/use-cases/get-model-canvas-data-marts.service.js +16 -3
- package/dist/src/data-marts/use-cases/get-report-generated-sql.service.js +1 -1
- package/dist/src/data-marts/use-cases/legacy-data-marts/move-legacy-data-storage.service.js +11 -2
- package/dist/src/data-marts/use-cases/list-project-scheduled-triggers.service.js +1 -1
- package/dist/src/data-marts/use-cases/preview-data-mart.service.d.ts +59 -0
- package/dist/src/data-marts/use-cases/preview-data-mart.service.js +293 -0
- package/dist/src/data-marts/use-cases/run-report.service.js +8 -9
- package/dist/src/data-marts/use-cases/stream-http-data.service.d.ts +3 -0
- package/dist/src/data-marts/use-cases/stream-http-data.service.js +16 -6
- package/dist/src/data-marts/use-cases/update-data-destination.service.js +7 -0
- package/dist/src/data-marts/use-cases/update-data-mart-definition.service.d.ts +1 -1
- package/dist/src/data-marts/use-cases/update-data-mart-definition.service.js +8 -6
- package/dist/src/data-marts/use-cases/update-data-mart-icon.service.d.ts +12 -0
- package/dist/src/data-marts/use-cases/update-data-mart-icon.service.js +46 -0
- package/dist/src/data-marts/use-cases/update-data-mart-schema.service.js +14 -1
- package/dist/src/data-marts/use-cases/update-data-mart-title.service.js +4 -0
- package/dist/src/data-marts/use-cases/update-report.service.d.ts +3 -1
- package/dist/src/data-marts/use-cases/update-report.service.js +17 -3
- package/dist/src/data-marts/utils/manual-backfill-range.d.ts +20 -0
- package/dist/src/data-marts/utils/manual-backfill-range.js +131 -0
- package/dist/src/ee/ee.module.js +5 -8
- package/dist/src/ee/mcp/auth/mcp-auth-context.d.ts +0 -4
- package/dist/src/ee/mcp/auth/mcp-auth.middleware.d.ts +26 -0
- package/dist/src/ee/mcp/auth/mcp-auth.middleware.js +184 -0
- package/dist/src/ee/mcp/http-headers.util.d.ts +2 -0
- package/dist/src/ee/mcp/http-headers.util.js +8 -0
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.d.ts +1 -1
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.js +1 -0
- package/dist/src/ee/mcp/observability/mcp-bus-wiring.js +4 -4
- package/dist/src/ee/mcp/observability/mcp-call-instrumentation.d.ts +2 -4
- package/dist/src/ee/mcp/observability/mcp-call-instrumentation.js +6 -6
- package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.d.ts +1 -1
- package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.js +5 -5
- package/dist/src/ee/mcp/tools/add-destination.tool.d.ts +20 -14
- package/dist/src/ee/mcp/tools/add-destination.tool.js +10 -10
- package/dist/src/ee/mcp/tools/add-report.tool.d.ts +88 -228
- package/dist/src/ee/mcp/tools/add-report.tool.js +28 -28
- package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.d.ts +2 -12
- package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.js +13 -13
- package/dist/src/ee/mcp/tools/data-mart-catalog.tool.d.ts +15 -81
- package/dist/src/ee/mcp/tools/data-mart-catalog.tool.js +11 -11
- package/dist/src/ee/mcp/tools/data-mart-details.tool.d.ts +19 -111
- package/dist/src/ee/mcp/tools/data-mart-details.tool.js +64 -48
- package/dist/src/ee/mcp/tools/delete-report-run-schedule.tool.d.ts +2 -6
- package/dist/src/ee/mcp/tools/delete-report-run-schedule.tool.js +7 -7
- package/dist/src/ee/mcp/tools/delete-report.tool.d.ts +3 -7
- package/dist/src/ee/mcp/tools/delete-report.tool.js +5 -5
- package/dist/src/ee/mcp/tools/get-data-mart-reports.tool.d.ts +30 -195
- package/dist/src/ee/mcp/tools/get-data-mart-reports.tool.js +22 -22
- package/dist/src/ee/mcp/tools/get-report-output-schema.tool.d.ts +3 -21
- package/dist/src/ee/mcp/tools/get-report-output-schema.tool.js +10 -10
- package/dist/src/ee/mcp/tools/get-report-run-status.tool.d.ts +15 -11
- package/dist/src/ee/mcp/tools/get-report-run-status.tool.js +14 -14
- package/dist/src/ee/mcp/tools/list-destinations.tool.d.ts +12 -20
- package/dist/src/ee/mcp/tools/list-destinations.tool.js +10 -10
- package/dist/src/ee/mcp/tools/list-report-run-schedules.tool.d.ts +5 -61
- package/dist/src/ee/mcp/tools/list-report-run-schedules.tool.js +14 -14
- package/dist/src/ee/mcp/tools/mcp-getting-started.util.d.ts +4 -52
- package/dist/src/ee/mcp/tools/mcp-getting-started.util.js +13 -13
- package/dist/src/ee/mcp/tools/mcp-tool.definition.d.ts +2 -2
- package/dist/src/ee/mcp/tools/mcp-tool.providers.js +2 -0
- package/dist/src/ee/mcp/tools/project-context.tool.d.ts +3 -17
- package/dist/src/ee/mcp/tools/project-context.tool.js +10 -10
- package/dist/src/ee/mcp/tools/query-data-mart.input.d.ts +111 -152
- package/dist/src/ee/mcp/tools/query-data-mart.input.js +39 -39
- package/dist/src/ee/mcp/tools/query-data-mart.tool.d.ts +60 -130
- package/dist/src/ee/mcp/tools/query-data-mart.tool.js +41 -37
- package/dist/src/ee/mcp/tools/report-output-controls-output.d.ts +17 -60
- package/dist/src/ee/mcp/tools/report-output-controls-output.js +20 -20
- package/dist/src/ee/mcp/tools/report-run-outcome.d.ts +6 -42
- package/dist/src/ee/mcp/tools/report-run-outcome.js +20 -20
- package/dist/src/ee/mcp/tools/run-report.tool.d.ts +2 -6
- package/dist/src/ee/mcp/tools/run-report.tool.js +5 -5
- package/dist/src/ee/mcp/tools/search-data-marts.tool.d.ts +7 -79
- package/dist/src/ee/mcp/tools/search-data-marts.tool.js +11 -11
- package/dist/src/ee/mcp/tools/search-reports.tool.d.ts +61 -0
- package/dist/src/ee/mcp/tools/search-reports.tool.js +106 -0
- package/dist/src/ee/mcp/tools/summarize-data-catalog.tool.d.ts +7 -79
- package/dist/src/ee/mcp/tools/summarize-data-catalog.tool.js +15 -15
- package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.d.ts +2 -12
- package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.js +13 -13
- package/dist/src/ee/mcp/tools/update-report.tool.d.ts +105 -414
- package/dist/src/ee/mcp/tools/update-report.tool.js +20 -20
- package/dist/src/ee/mcp/transport/mcp-http-entry.service.d.ts +30 -0
- package/dist/src/ee/mcp/transport/mcp-http-entry.service.js +193 -0
- package/dist/src/idp/guards/idp.guard.js +2 -8
- package/dist/src/idp/oauth/controllers/oauth-authorization.controller.d.ts +4 -0
- package/dist/src/idp/oauth/controllers/oauth-authorization.controller.js +77 -1
- package/dist/src/idp/oauth/controllers/oauth-metadata.controller.d.ts +2 -1
- package/dist/src/idp/oauth/controllers/oauth-metadata.controller.js +5 -8
- package/dist/src/idp/oauth/controllers/oauth-token.controller.js +14 -1
- package/dist/src/idp/oauth/oauth-request.validator.d.ts +8 -0
- package/dist/src/idp/oauth/oauth-request.validator.js +27 -0
- package/dist/src/idp/utils/is-authentication-error.d.ts +1 -0
- package/dist/src/idp/utils/is-authentication-error.js +9 -0
- package/dist/src/idp/utils/role-hierarchy.d.ts +3 -0
- package/dist/src/idp/utils/role-hierarchy.js +14 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/migrations/1779200000000-migrate-prejoin-filter-to-unified-column.js +1 -0
- package/dist/src/migrations/1787788800004-create-report-search-index-tables.d.ts +7 -0
- package/dist/src/migrations/1787788800004-create-report-search-index-tables.js +84 -0
- package/dist/src/migrations/1787788800005-add-report-reindex-progress.d.ts +5 -0
- package/dist/src/migrations/1787788800005-add-report-reindex-progress.js +39 -0
- package/dist/src/migrations/1788048000000-create-connector-definition-tables.d.ts +6 -0
- package/dist/src/migrations/1788048000000-create-connector-definition-tables.js +116 -0
- package/dist/src/migrations/1789646400000-add-soft-delete-to-report.d.ts +6 -0
- package/dist/src/migrations/1789646400000-add-soft-delete-to-report.js +15 -0
- package/dist/src/migrations/1790156789783-add-auto-aggregation-opt-out-to-report.d.ts +8 -0
- package/dist/src/migrations/1790156789783-add-auto-aggregation-opt-out-to-report.js +30 -0
- package/dist/src/migrations/1790247861000-add-icon-to-data-mart.d.ts +8 -0
- package/dist/src/migrations/1790247861000-add-icon-to-data-mart.js +31 -0
- package/package.json +11 -7
- package/dist/src/ee/mcp/auth/mcp-auth.exception-filter.d.ts +0 -14
- package/dist/src/ee/mcp/auth/mcp-auth.exception-filter.js +0 -84
- package/dist/src/ee/mcp/auth/mcp-auth.guard.d.ts +0 -14
- package/dist/src/ee/mcp/auth/mcp-auth.guard.js +0 -99
- package/dist/src/ee/mcp/controllers/mcp-transport.controller.d.ts +0 -17
- package/dist/src/ee/mcp/controllers/mcp-transport.controller.js +0 -134
- package/dist/src/ee/mcp/sdk/mcp-streamable-http-transport.handler.d.ts +0 -16
- package/dist/src/ee/mcp/sdk/mcp-streamable-http-transport.handler.js +0 -133
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BusinessViolationException } from './business-violation.exception';
|
|
2
2
|
export declare class ConcurrencyLimitExceededException extends BusinessViolationException {
|
|
3
|
-
constructor(message: string, errorDetails?: Record<string, unknown
|
|
3
|
+
constructor(message: string, errorDetails?: Record<string, unknown>, code?: string);
|
|
4
4
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConcurrencyLimitExceededException = void 0;
|
|
4
4
|
const business_violation_exception_1 = require("./business-violation.exception");
|
|
5
5
|
class ConcurrencyLimitExceededException extends business_violation_exception_1.BusinessViolationException {
|
|
6
|
-
constructor(message, errorDetails) {
|
|
7
|
-
super(message, errorDetails);
|
|
6
|
+
constructor(message, errorDetails, code) {
|
|
7
|
+
super(message, errorDetails, code);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.ConcurrencyLimitExceededException = ConcurrencyLimitExceededException;
|
|
@@ -84,6 +84,20 @@ var COLOR_THEME;
|
|
|
84
84
|
})(COLOR_THEME || (exports.COLOR_THEME = COLOR_THEME = {}));
|
|
85
85
|
let MarkdownParser = class MarkdownParser {
|
|
86
86
|
async parseToHtml(markdown, theme = COLOR_THEME.DYNAMIC) {
|
|
87
|
+
const html = await this.runPipeline(markdown);
|
|
88
|
+
const content = `<div class="markdown-body">${html}</div>`;
|
|
89
|
+
return juice_1.default.inlineContent(content, this.getColorThemeCss(theme), {
|
|
90
|
+
preserveMediaQueries: true,
|
|
91
|
+
applyAttributesTableElements: true,
|
|
92
|
+
applyWidthAttributes: true,
|
|
93
|
+
applyHeightAttributes: true,
|
|
94
|
+
resolveCSSVariables: true,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async parseToFragment(markdown) {
|
|
98
|
+
return this.runPipeline(markdown);
|
|
99
|
+
}
|
|
100
|
+
async runPipeline(markdown) {
|
|
87
101
|
const html = await (0, remark_1.remark)()
|
|
88
102
|
.use(remark_parse_1.default)
|
|
89
103
|
.use(remark_gfm_1.default)
|
|
@@ -93,14 +107,7 @@ let MarkdownParser = class MarkdownParser {
|
|
|
93
107
|
.use(rehype_normalize_table_truncation_notice_plugin_1.rehypeNormalizeTableTruncationNoticeRows)
|
|
94
108
|
.use(rehype_stringify_1.default)
|
|
95
109
|
.process(markdown);
|
|
96
|
-
|
|
97
|
-
return juice_1.default.inlineContent(content, this.getColorThemeCss(theme), {
|
|
98
|
-
preserveMediaQueries: true,
|
|
99
|
-
applyAttributesTableElements: true,
|
|
100
|
-
applyWidthAttributes: true,
|
|
101
|
-
applyHeightAttributes: true,
|
|
102
|
-
resolveCSSVariables: true,
|
|
103
|
-
});
|
|
110
|
+
return String(html);
|
|
104
111
|
}
|
|
105
112
|
getColorThemeCss(theme) {
|
|
106
113
|
let cssVariables;
|
|
@@ -3,7 +3,19 @@ export declare const SEARCH_SEMANTIC_ENGINE: unique symbol;
|
|
|
3
3
|
export declare enum SearchableEntityType {
|
|
4
4
|
DATA_MART = "DATA_MART",
|
|
5
5
|
DATA_STORAGE = "DATA_STORAGE",
|
|
6
|
-
DATA_DESTINATION = "DATA_DESTINATION"
|
|
6
|
+
DATA_DESTINATION = "DATA_DESTINATION",
|
|
7
|
+
REPORT = "REPORT"
|
|
8
|
+
}
|
|
9
|
+
export interface SearchReportRef {
|
|
10
|
+
dataMart: {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
dataDestination: {
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
7
19
|
}
|
|
8
20
|
export interface SearchResult {
|
|
9
21
|
entityType: SearchableEntityType;
|
|
@@ -13,6 +25,8 @@ export interface SearchResult {
|
|
|
13
25
|
finalScore: number;
|
|
14
26
|
kwScore: number;
|
|
15
27
|
vecScore: number | null;
|
|
28
|
+
report?: SearchReportRef;
|
|
29
|
+
url?: string;
|
|
16
30
|
}
|
|
17
31
|
export interface SearchAccessScope {
|
|
18
32
|
userId: string;
|
|
@@ -8,5 +8,6 @@ var SearchableEntityType;
|
|
|
8
8
|
SearchableEntityType["DATA_MART"] = "DATA_MART";
|
|
9
9
|
SearchableEntityType["DATA_STORAGE"] = "DATA_STORAGE";
|
|
10
10
|
SearchableEntityType["DATA_DESTINATION"] = "DATA_DESTINATION";
|
|
11
|
+
SearchableEntityType["REPORT"] = "REPORT";
|
|
11
12
|
})(SearchableEntityType || (exports.SearchableEntityType = SearchableEntityType = {}));
|
|
12
13
|
//# sourceMappingURL=search.facade.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MaxByteLength = MaxByteLength;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
function MaxByteLength(maxSizeBytes, validationOptions) {
|
|
6
|
+
return function (object, propertyName) {
|
|
7
|
+
(0, class_validator_1.registerDecorator)({
|
|
8
|
+
name: 'maxByteLength',
|
|
9
|
+
target: object.constructor,
|
|
10
|
+
propertyName: propertyName,
|
|
11
|
+
options: validationOptions,
|
|
12
|
+
constraints: [maxSizeBytes],
|
|
13
|
+
validator: {
|
|
14
|
+
validate(value, args) {
|
|
15
|
+
if (typeof value !== 'string') {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
const [maxSize] = args.constraints;
|
|
19
|
+
return Buffer.byteLength(value, 'utf8') <= maxSize;
|
|
20
|
+
},
|
|
21
|
+
defaultMessage(args) {
|
|
22
|
+
const [maxSize] = args.constraints;
|
|
23
|
+
return `${args.property} must be shorter than or equal to ${maxSize} bytes`;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=max-byte-length.validator.js.map
|
|
@@ -7,6 +7,10 @@ declare const configSchema: z.ZodObject<{
|
|
|
7
7
|
HEADERS_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
8
8
|
MAX_CONNECTOR_RUNS_PER_PROJECT: z.ZodDefault<z.ZodNumber>;
|
|
9
9
|
MAX_REPORT_RUNS_PER_PROJECT: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
CONNECTOR_SHORT_LINK_DOMAINS: z.ZodOptional<z.ZodString>;
|
|
11
|
+
MAX_CONNECTOR_TESTS_PER_PROJECT: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
12
|
+
MAX_CONNECTOR_TESTS_TOTAL: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
13
|
+
CONNECTOR_RUN_LOG_FLUSH_INTERVAL_MS: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
10
14
|
PLUGIN_HOST_SYNC_MIN_INTERVAL_SEC: z.ZodOptional<z.ZodNumber>;
|
|
11
15
|
PLUGIN_HOST_REMOTE_PROBE_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
12
16
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -17,6 +21,10 @@ declare const configSchema: z.ZodObject<{
|
|
|
17
21
|
HEADERS_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
18
22
|
MAX_CONNECTOR_RUNS_PER_PROJECT: z.ZodDefault<z.ZodNumber>;
|
|
19
23
|
MAX_REPORT_RUNS_PER_PROJECT: z.ZodDefault<z.ZodNumber>;
|
|
24
|
+
CONNECTOR_SHORT_LINK_DOMAINS: z.ZodOptional<z.ZodString>;
|
|
25
|
+
MAX_CONNECTOR_TESTS_PER_PROJECT: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
26
|
+
MAX_CONNECTOR_TESTS_TOTAL: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
27
|
+
CONNECTOR_RUN_LOG_FLUSH_INTERVAL_MS: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
20
28
|
PLUGIN_HOST_SYNC_MIN_INTERVAL_SEC: z.ZodOptional<z.ZodNumber>;
|
|
21
29
|
PLUGIN_HOST_REMOTE_PROBE_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
22
30
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
@@ -27,6 +35,10 @@ declare const configSchema: z.ZodObject<{
|
|
|
27
35
|
HEADERS_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
28
36
|
MAX_CONNECTOR_RUNS_PER_PROJECT: z.ZodDefault<z.ZodNumber>;
|
|
29
37
|
MAX_REPORT_RUNS_PER_PROJECT: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
CONNECTOR_SHORT_LINK_DOMAINS: z.ZodOptional<z.ZodString>;
|
|
39
|
+
MAX_CONNECTOR_TESTS_PER_PROJECT: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
40
|
+
MAX_CONNECTOR_TESTS_TOTAL: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
41
|
+
CONNECTOR_RUN_LOG_FLUSH_INTERVAL_MS: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, unknown>;
|
|
30
42
|
PLUGIN_HOST_SYNC_MIN_INTERVAL_SEC: z.ZodOptional<z.ZodNumber>;
|
|
31
43
|
PLUGIN_HOST_REMOTE_PROBE_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
32
44
|
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateConfig = validateConfig;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
|
+
function blankAsUnset(schema) {
|
|
7
|
+
return zod_1.z.preprocess(value => (typeof value === 'string' && value.trim() === '' ? undefined : value), schema);
|
|
8
|
+
}
|
|
6
9
|
const configSchema = zod_1.z
|
|
7
10
|
.object({
|
|
8
11
|
SCHEDULER_EXECUTION_ENABLED: zod_1.z
|
|
@@ -17,6 +20,10 @@ const configSchema = zod_1.z
|
|
|
17
20
|
HEADERS_TIMEOUT_MS: zod_1.z.coerce.number().default(constants_1.DEFAULT_HEADERS_TIMEOUT_MS),
|
|
18
21
|
MAX_CONNECTOR_RUNS_PER_PROJECT: zod_1.z.coerce.number().int().min(1).max(1000).default(3),
|
|
19
22
|
MAX_REPORT_RUNS_PER_PROJECT: zod_1.z.coerce.number().int().min(1).max(1000).default(1000),
|
|
23
|
+
CONNECTOR_SHORT_LINK_DOMAINS: zod_1.z.string().trim().optional(),
|
|
24
|
+
MAX_CONNECTOR_TESTS_PER_PROJECT: blankAsUnset(zod_1.z.coerce.number().int().min(1).max(1000).default(3)),
|
|
25
|
+
MAX_CONNECTOR_TESTS_TOTAL: blankAsUnset(zod_1.z.coerce.number().int().min(1).max(1000).default(10)),
|
|
26
|
+
CONNECTOR_RUN_LOG_FLUSH_INTERVAL_MS: blankAsUnset(zod_1.z.coerce.number().int().min(0).max(3_600_000).default(2_000)),
|
|
20
27
|
PLUGIN_HOST_SYNC_MIN_INTERVAL_SEC: zod_1.z.coerce.number().int().min(0).max(86_400).optional(),
|
|
21
28
|
PLUGIN_HOST_REMOTE_PROBE_TIMEOUT_MS: zod_1.z.coerce
|
|
22
29
|
.number()
|
|
@@ -252,12 +252,12 @@ export declare const QueryPlanWhereSpecSchema: z.ZodObject<{
|
|
|
252
252
|
}, "strip", z.ZodTypeAny, {
|
|
253
253
|
value: string | number | boolean | string[] | number[] | null;
|
|
254
254
|
required: boolean;
|
|
255
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
255
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
256
256
|
field: string;
|
|
257
257
|
notes?: string | undefined;
|
|
258
258
|
}, {
|
|
259
259
|
value: string | number | boolean | string[] | number[] | null;
|
|
260
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
260
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
261
261
|
field: string;
|
|
262
262
|
required?: boolean | undefined;
|
|
263
263
|
notes?: string | undefined;
|
|
@@ -339,12 +339,12 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
339
339
|
}, "strip", z.ZodTypeAny, {
|
|
340
340
|
value: string | number | boolean | string[] | number[] | null;
|
|
341
341
|
required: boolean;
|
|
342
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
342
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
343
343
|
field: string;
|
|
344
344
|
notes?: string | undefined;
|
|
345
345
|
}, {
|
|
346
346
|
value: string | number | boolean | string[] | number[] | null;
|
|
347
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
347
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
348
348
|
field: string;
|
|
349
349
|
required?: boolean | undefined;
|
|
350
350
|
notes?: string | undefined;
|
|
@@ -453,6 +453,7 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
453
453
|
}>>>;
|
|
454
454
|
}, "strip", z.ZodTypeAny, {
|
|
455
455
|
dimensions: string[];
|
|
456
|
+
metrics: string[];
|
|
456
457
|
tables: {
|
|
457
458
|
fullyQualifiedName: string;
|
|
458
459
|
role?: string | null | undefined;
|
|
@@ -463,7 +464,6 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
463
464
|
alias: string;
|
|
464
465
|
sourceColumn: string;
|
|
465
466
|
}[];
|
|
466
|
-
metrics: string[];
|
|
467
467
|
metricSpecs: {
|
|
468
468
|
name: string;
|
|
469
469
|
required: boolean;
|
|
@@ -475,7 +475,7 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
475
475
|
whereSpecs: {
|
|
476
476
|
value: string | number | boolean | string[] | number[] | null;
|
|
477
477
|
required: boolean;
|
|
478
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
478
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
479
479
|
field: string;
|
|
480
480
|
notes?: string | undefined;
|
|
481
481
|
}[];
|
|
@@ -517,7 +517,7 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
517
517
|
}[];
|
|
518
518
|
whereSpecs: {
|
|
519
519
|
value: string | number | boolean | string[] | number[] | null;
|
|
520
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
520
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
521
521
|
field: string;
|
|
522
522
|
required?: boolean | undefined;
|
|
523
523
|
notes?: string | undefined;
|
|
@@ -529,6 +529,7 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
529
529
|
required?: boolean | undefined;
|
|
530
530
|
}[];
|
|
531
531
|
dimensions?: string[] | undefined;
|
|
532
|
+
metrics?: string[] | undefined;
|
|
532
533
|
tables?: {
|
|
533
534
|
fullyQualifiedName: string;
|
|
534
535
|
role?: string | null | undefined;
|
|
@@ -540,7 +541,6 @@ export declare const QueryPlanSchema: z.ZodObject<{
|
|
|
540
541
|
sourceColumn: string;
|
|
541
542
|
required?: boolean | undefined;
|
|
542
543
|
}[] | undefined;
|
|
543
|
-
metrics?: string[] | undefined;
|
|
544
544
|
dateField?: string | null | undefined;
|
|
545
545
|
dateFilterDescription?: string | null | undefined;
|
|
546
546
|
whereConditions?: string[] | undefined;
|
|
@@ -625,12 +625,12 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
625
625
|
}, "strip", z.ZodTypeAny, {
|
|
626
626
|
value: string | number | boolean | string[] | number[] | null;
|
|
627
627
|
required: boolean;
|
|
628
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
628
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
629
629
|
field: string;
|
|
630
630
|
notes?: string | undefined;
|
|
631
631
|
}, {
|
|
632
632
|
value: string | number | boolean | string[] | number[] | null;
|
|
633
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
633
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
634
634
|
field: string;
|
|
635
635
|
required?: boolean | undefined;
|
|
636
636
|
notes?: string | undefined;
|
|
@@ -739,6 +739,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
739
739
|
}>>>;
|
|
740
740
|
}, "strip", z.ZodTypeAny, {
|
|
741
741
|
dimensions: string[];
|
|
742
|
+
metrics: string[];
|
|
742
743
|
tables: {
|
|
743
744
|
fullyQualifiedName: string;
|
|
744
745
|
role?: string | null | undefined;
|
|
@@ -749,7 +750,6 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
749
750
|
alias: string;
|
|
750
751
|
sourceColumn: string;
|
|
751
752
|
}[];
|
|
752
|
-
metrics: string[];
|
|
753
753
|
metricSpecs: {
|
|
754
754
|
name: string;
|
|
755
755
|
required: boolean;
|
|
@@ -761,7 +761,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
761
761
|
whereSpecs: {
|
|
762
762
|
value: string | number | boolean | string[] | number[] | null;
|
|
763
763
|
required: boolean;
|
|
764
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
764
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
765
765
|
field: string;
|
|
766
766
|
notes?: string | undefined;
|
|
767
767
|
}[];
|
|
@@ -803,7 +803,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
803
803
|
}[];
|
|
804
804
|
whereSpecs: {
|
|
805
805
|
value: string | number | boolean | string[] | number[] | null;
|
|
806
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
806
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
807
807
|
field: string;
|
|
808
808
|
required?: boolean | undefined;
|
|
809
809
|
notes?: string | undefined;
|
|
@@ -815,6 +815,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
815
815
|
required?: boolean | undefined;
|
|
816
816
|
}[];
|
|
817
817
|
dimensions?: string[] | undefined;
|
|
818
|
+
metrics?: string[] | undefined;
|
|
818
819
|
tables?: {
|
|
819
820
|
fullyQualifiedName: string;
|
|
820
821
|
role?: string | null | undefined;
|
|
@@ -826,7 +827,6 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
826
827
|
sourceColumn: string;
|
|
827
828
|
required?: boolean | undefined;
|
|
828
829
|
}[] | undefined;
|
|
829
|
-
metrics?: string[] | undefined;
|
|
830
830
|
dateField?: string | null | undefined;
|
|
831
831
|
dateFilterDescription?: string | null | undefined;
|
|
832
832
|
whereConditions?: string[] | undefined;
|
|
@@ -855,6 +855,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
855
855
|
}, "strip", z.ZodTypeAny, {
|
|
856
856
|
plan: {
|
|
857
857
|
dimensions: string[];
|
|
858
|
+
metrics: string[];
|
|
858
859
|
tables: {
|
|
859
860
|
fullyQualifiedName: string;
|
|
860
861
|
role?: string | null | undefined;
|
|
@@ -865,7 +866,6 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
865
866
|
alias: string;
|
|
866
867
|
sourceColumn: string;
|
|
867
868
|
}[];
|
|
868
|
-
metrics: string[];
|
|
869
869
|
metricSpecs: {
|
|
870
870
|
name: string;
|
|
871
871
|
required: boolean;
|
|
@@ -877,7 +877,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
877
877
|
whereSpecs: {
|
|
878
878
|
value: string | number | boolean | string[] | number[] | null;
|
|
879
879
|
required: boolean;
|
|
880
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
880
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
881
881
|
field: string;
|
|
882
882
|
notes?: string | undefined;
|
|
883
883
|
}[];
|
|
@@ -923,7 +923,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
923
923
|
}[];
|
|
924
924
|
whereSpecs: {
|
|
925
925
|
value: string | number | boolean | string[] | number[] | null;
|
|
926
|
-
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "
|
|
926
|
+
operator: "between" | "in" | "ilike" | "like" | "is_null" | "is_not_null" | "<" | ">" | "=" | "!=" | ">=" | "<=";
|
|
927
927
|
field: string;
|
|
928
928
|
required?: boolean | undefined;
|
|
929
929
|
notes?: string | undefined;
|
|
@@ -935,6 +935,7 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
935
935
|
required?: boolean | undefined;
|
|
936
936
|
}[];
|
|
937
937
|
dimensions?: string[] | undefined;
|
|
938
|
+
metrics?: string[] | undefined;
|
|
938
939
|
tables?: {
|
|
939
940
|
fullyQualifiedName: string;
|
|
940
941
|
role?: string | null | undefined;
|
|
@@ -946,7 +947,6 @@ export declare const PlanModelJsonSchema: z.ZodObject<{
|
|
|
946
947
|
sourceColumn: string;
|
|
947
948
|
required?: boolean | undefined;
|
|
948
949
|
}[] | undefined;
|
|
949
|
-
metrics?: string[] | undefined;
|
|
950
950
|
dateField?: string | null | undefined;
|
|
951
951
|
dateFilterDescription?: string | null | undefined;
|
|
952
952
|
whereConditions?: string[] | undefined;
|
|
@@ -23,6 +23,7 @@ const formula_analyzer_1 = require("./formula-analyzer");
|
|
|
23
23
|
const formula_level_1 = require("./formula-level");
|
|
24
24
|
const formula_function_dialect_1 = require("./formula-function-dialect");
|
|
25
25
|
const formula_violations_1 = require("./formula-violations");
|
|
26
|
+
const join_grain_1 = require("./join-grain");
|
|
26
27
|
const unique_count_sources_1 = require("../dto/schemas/unique-count-sources");
|
|
27
28
|
const sql_token_scanner_1 = require("./sql-token-scanner");
|
|
28
29
|
const formula_reference_1 = require("./formula-reference");
|
|
@@ -63,26 +64,6 @@ function dryRunBatches(fields) {
|
|
|
63
64
|
return [fields];
|
|
64
65
|
return [aggregate, rowLevel];
|
|
65
66
|
}
|
|
66
|
-
function formulaDependencyGraph(fields, byName) {
|
|
67
|
-
const dependenciesOf = (field) => {
|
|
68
|
-
let references;
|
|
69
|
-
try {
|
|
70
|
-
references = (0, formula_live_reference_1.liveFormulaReferences)(field.calculated.formula);
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
const named = references
|
|
76
|
-
.filter(ref => !ref.path)
|
|
77
|
-
.map(ref => ref.field)
|
|
78
|
-
.filter(name => {
|
|
79
|
-
const found = byName.get(name);
|
|
80
|
-
return found !== undefined && (0, calculated_field_utils_1.isCalculatedField)(found);
|
|
81
|
-
});
|
|
82
|
-
return [...new Set(named)];
|
|
83
|
-
};
|
|
84
|
-
return new Map(fields.map(field => [field.name, dependenciesOf(field)]));
|
|
85
|
-
}
|
|
86
67
|
function formulaCycleViolations(cycles) {
|
|
87
68
|
return cycles.flatMap(chain => {
|
|
88
69
|
const members = [...new Set(chain)];
|
|
@@ -114,9 +95,13 @@ let CalculatedFieldValidatorService = class CalculatedFieldValidatorService {
|
|
|
114
95
|
const byName = new Map((0, data_mart_schema_utils_1.collectFormulaReferenceableFields)(schema.fields)
|
|
115
96
|
.filter(d => !(0, calculated_field_utils_1.isCalculatedField)(d.field) || topLevelCalculated.has(d.field))
|
|
116
97
|
.map(d => [d.name, d.field]));
|
|
117
|
-
const joinTreeRead = await this.resolveJoinedReferences(calculated, joinTree);
|
|
98
|
+
const joinTreeRead = await this.resolveJoinedReferences(calculated, joinTree, schema.fields);
|
|
118
99
|
const joinedIndex = joinTreeRead?.index;
|
|
119
|
-
const
|
|
100
|
+
const grainSources = (0, join_grain_1.buildJoinGrainSources)(joinTreeRead?.schema.availableSources ?? [], {
|
|
101
|
+
kind: 'editor',
|
|
102
|
+
});
|
|
103
|
+
const dependencies = (0, calculated_field_utils_1.formulaDependencyGraph)(calculated, byName);
|
|
104
|
+
const walk = (0, formula_reference_1.walkFormulaDependencies)(dependencies);
|
|
120
105
|
const errors = formulaCycleViolations(walk.cycles);
|
|
121
106
|
const warnings = [];
|
|
122
107
|
const analysed = [];
|
|
@@ -151,13 +136,20 @@ let CalculatedFieldValidatorService = class CalculatedFieldValidatorService {
|
|
|
151
136
|
dialect,
|
|
152
137
|
knownField,
|
|
153
138
|
});
|
|
139
|
+
const fieldErrors = [
|
|
140
|
+
...joinedViolations.values(),
|
|
141
|
+
...[...mainUniqueCountRefs].map(ref => formula_violations_1.FormulaViolations.mainUniqueCountReference(field.name, ref)),
|
|
142
|
+
...analysis.errors,
|
|
143
|
+
];
|
|
144
|
+
const grain = (0, join_grain_1.checkJoinGrain)({
|
|
145
|
+
fieldName: field.name,
|
|
146
|
+
aggregateCalls: analysis.aggregateCalls,
|
|
147
|
+
sources: grainSources,
|
|
148
|
+
});
|
|
149
|
+
const fieldWarnings = [...analysis.warnings, ...grain.warnings];
|
|
154
150
|
analyses.set(field, {
|
|
155
|
-
errors:
|
|
156
|
-
|
|
157
|
-
...[...mainUniqueCountRefs].map(ref => formula_violations_1.FormulaViolations.mainUniqueCountReference(field.name, ref)),
|
|
158
|
-
...analysis.errors,
|
|
159
|
-
],
|
|
160
|
-
warnings: analysis.warnings,
|
|
151
|
+
errors: fieldErrors,
|
|
152
|
+
warnings: fieldWarnings,
|
|
161
153
|
level: analysis.level,
|
|
162
154
|
});
|
|
163
155
|
derivedLevels.set(field.name, analysis.level);
|
|
@@ -206,12 +198,12 @@ let CalculatedFieldValidatorService = class CalculatedFieldValidatorService {
|
|
|
206
198
|
}
|
|
207
199
|
return { errors, warnings };
|
|
208
200
|
}
|
|
209
|
-
async resolveJoinedReferences(fields, joinTree) {
|
|
201
|
+
async resolveJoinedReferences(fields, joinTree, schemaFields) {
|
|
210
202
|
if (!joinTree?.accessor.userId)
|
|
211
203
|
return undefined;
|
|
212
204
|
if (!fields.some(f => (0, formula_live_reference_1.hasLiveJoinedReference)(f.calculated.formula)))
|
|
213
205
|
return undefined;
|
|
214
|
-
const blendable = await this.blendableSchemaService.computeBlendableSchema(joinTree.dataMartId, joinTree.projectId, joinTree.accessor);
|
|
206
|
+
const blendable = await this.blendableSchemaService.computeBlendableSchema(joinTree.dataMartId, joinTree.projectId, joinTree.accessor, { unsavedMainSchemaFields: schemaFields });
|
|
215
207
|
return { schema: blendable, index: (0, calculated_field_utils_1.buildJoinedReferenceIndex)(blendable) };
|
|
216
208
|
}
|
|
217
209
|
resolveJoinedReference(metricName, path, refField, index, violations) {
|
|
@@ -49,3 +49,4 @@ export declare function joinedCalculatedFieldRefusals(blendedFields: readonly {
|
|
|
49
49
|
isCalculated?: boolean;
|
|
50
50
|
sourceDataMartTitle?: string;
|
|
51
51
|
}[], referencedColumns: Iterable<string>, ownColumnNames: ReadonlySet<string>): JoinedCalculatedFieldRefusal[];
|
|
52
|
+
export declare function formulaDependencyGraph(fields: readonly CalculatedSchemaField[], byName: ReadonlyMap<string, DataMartSchemaField>): ReadonlyMap<string, readonly string[]>;
|
|
@@ -17,6 +17,7 @@ exports.brokenReferencesOf = brokenReferencesOf;
|
|
|
17
17
|
exports.buildJoinedReferenceIndex = buildJoinedReferenceIndex;
|
|
18
18
|
exports.brokenJoinedReferencesOf = brokenJoinedReferencesOf;
|
|
19
19
|
exports.joinedCalculatedFieldRefusals = joinedCalculatedFieldRefusals;
|
|
20
|
+
exports.formulaDependencyGraph = formulaDependencyGraph;
|
|
20
21
|
const formula_live_reference_1 = require("./formula-live-reference");
|
|
21
22
|
const formula_level_1 = require("./formula-level");
|
|
22
23
|
const formula_function_dialect_1 = require("./formula-function-dialect");
|
|
@@ -275,4 +276,24 @@ function joinedCalculatedFieldRefusals(blendedFields, referencedColumns, ownColu
|
|
|
275
276
|
}
|
|
276
277
|
return refusals;
|
|
277
278
|
}
|
|
279
|
+
function formulaDependencyGraph(fields, byName) {
|
|
280
|
+
const dependenciesOf = (field) => {
|
|
281
|
+
let references;
|
|
282
|
+
try {
|
|
283
|
+
references = (0, formula_live_reference_1.liveFormulaReferences)(field.calculated.formula);
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
return [];
|
|
287
|
+
}
|
|
288
|
+
const named = references
|
|
289
|
+
.filter(ref => !ref.path)
|
|
290
|
+
.map(ref => ref.field)
|
|
291
|
+
.filter(name => {
|
|
292
|
+
const found = byName.get(name);
|
|
293
|
+
return found !== undefined && isCalculatedField(found);
|
|
294
|
+
});
|
|
295
|
+
return [...new Set(named)];
|
|
296
|
+
};
|
|
297
|
+
return new Map(fields.map(field => [field.name, dependenciesOf(field)]));
|
|
298
|
+
}
|
|
278
299
|
//# sourceMappingURL=calculated-field.utils.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.analyzeFormula = analyzeFormula;
|
|
4
4
|
const formula_reference_1 = require("./formula-reference");
|
|
5
|
+
const set_quantifier_1 = require("./set-quantifier");
|
|
5
6
|
const sql_token_scanner_1 = require("./sql-token-scanner");
|
|
6
7
|
const sql_function_calls_1 = require("./sql-function-calls");
|
|
7
8
|
const formula_violations_1 = require("./formula-violations");
|
|
@@ -90,6 +91,7 @@ function analyzeFormula(input) {
|
|
|
90
91
|
aggregateCalls.push({
|
|
91
92
|
name: call.name,
|
|
92
93
|
owner: inside[0].path,
|
|
94
|
+
distinct: (0, set_quantifier_1.readSetQuantifier)(tokens, call).distinct,
|
|
93
95
|
references: inside,
|
|
94
96
|
nameStart: call.nameStart,
|
|
95
97
|
});
|
|
@@ -4,6 +4,9 @@ export interface FormulaViolation {
|
|
|
4
4
|
field: string;
|
|
5
5
|
subject?: string;
|
|
6
6
|
}
|
|
7
|
+
export declare const UNNAMED_JOINED_SOURCE = "a joined Data Mart";
|
|
8
|
+
export type MultipliedRowsOf = 'this Data Mart' | 'its parent';
|
|
9
|
+
export type UniqueCountOffer = 'none' | 'report' | 'query';
|
|
7
10
|
export declare const FormulaViolations: {
|
|
8
11
|
levelMixing: (field: string, column: string) => FormulaViolation;
|
|
9
12
|
joinedReferenceOutsideAggregate: (field: string, ref: string) => FormulaViolation;
|
|
@@ -35,6 +38,10 @@ export declare const FormulaViolations: {
|
|
|
35
38
|
tagInStringLiteral: (field: string) => FormulaViolation;
|
|
36
39
|
syntax: (field: string, detail: string) => FormulaViolation;
|
|
37
40
|
unguardedDivision: (field: string, denominator?: string) => FormulaViolation;
|
|
41
|
+
joinedMeasureMultiplied: (field: string, ref: string | undefined, source: string, key: readonly string[] | undefined, multipliedBy?: string, rowsOf?: MultipliedRowsOf, uniqueCount?: UniqueCountOffer) => FormulaViolation;
|
|
42
|
+
joinedMeasureGrainUnproven: (field: string, ref: string | undefined, source: string, unprovenMart: string | undefined, collapses?: boolean, uniqueCount?: UniqueCountOffer) => FormulaViolation;
|
|
43
|
+
joinedMeasureCollapsed: (field: string, ref: string | undefined, source: string, collapsedBy?: string, uniqueCount?: UniqueCountOffer) => FormulaViolation;
|
|
44
|
+
joinedRowsExcluded: (field: string, sources: readonly string[]) => FormulaViolation;
|
|
38
45
|
warehouseRejected: (field: string, detail?: string) => FormulaViolation;
|
|
39
46
|
warehouseRejectedAsSet: (field: string, detail?: string) => FormulaViolation;
|
|
40
47
|
otherFieldErrorsTruncated: (field: string, omitted: number) => FormulaViolation;
|