@gooddata/sdk-maql-language-server 0.0.0-stage → 11.65.0-alpha.4
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/LICENSE +7 -0
- package/README.md +118 -2
- package/esm/completions/complete.d.ts +12 -0
- package/esm/completions/complete.d.ts.map +1 -0
- package/esm/completions/complete.js +316 -0
- package/esm/completions/descriptions.d.ts +42 -0
- package/esm/completions/descriptions.d.ts.map +1 -0
- package/esm/completions/descriptions.js +290 -0
- package/esm/completions/findContext.d.ts +19 -0
- package/esm/completions/findContext.d.ts.map +1 -0
- package/esm/completions/findContext.js +172 -0
- package/esm/completions/functionDescriptions.d.ts +3 -0
- package/esm/completions/functionDescriptions.d.ts.map +1 -0
- package/esm/completions/functionDescriptions.js +99 -0
- package/esm/completions/sort.d.ts +4 -0
- package/esm/completions/sort.d.ts.map +1 -0
- package/esm/completions/sort.js +88 -0
- package/esm/constants.d.ts +21 -0
- package/esm/constants.d.ts.map +1 -0
- package/esm/constants.js +22 -0
- package/esm/dateElementFormat.d.ts +9 -0
- package/esm/dateElementFormat.d.ts.map +1 -0
- package/esm/dateElementFormat.js +60 -0
- package/esm/decorations.d.ts +39 -0
- package/esm/decorations.d.ts.map +1 -0
- package/esm/decorations.js +42 -0
- package/esm/diagnostics.d.ts +12 -0
- package/esm/diagnostics.d.ts.map +1 -0
- package/esm/diagnostics.js +260 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/approximate_count.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/approximate_count.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/approximate_count.js +61 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/avg.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/avg.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/avg.js +19 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/count.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/count.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/count.js +72 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/first.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/first.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/first.js +41 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/last.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/last.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/last.js +69 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/max.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/max.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/max.js +61 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/median.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/median.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/median.js +25 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/min.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/min.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/min.js +63 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/sum.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/sum.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/aggregation/sum.js +20 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/case.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/case.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/case.js +73 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/if-then-else.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/if-then-else.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/if-then-else.js +29 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/ifnull.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/ifnull.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/conditionals/ifnull.js +96 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-ranking-filters.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-ranking-filters.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-ranking-filters.js +71 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-having-clause.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-having-clause.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-having-clause.js +65 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-like-clause.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-like-clause.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-like-clause.js +36 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-where-clause.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-where-clause.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-where-clause.js +36 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions-except-for-attribute.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions-except-for-attribute.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions-except-for-attribute.js +21 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions.js +27 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all.js +64 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-attribute-all-in-all-other-dimensions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-attribute-all-in-all-other-dimensions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-attribute-all-in-all-other-dimensions.js +22 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by.js +85 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-except.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-except.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-except.js +37 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-filter.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-filter.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-filter.js +42 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-except.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-except.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-except.js +94 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-filter.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-filter.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-filter.js +33 -0
- package/esm/docs/en/docs/create-metrics/maql/for-each.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/for-each.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/for-each.js +17 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/and.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/and.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/and.js +37 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/not.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/not.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/not.js +12 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/or.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/or.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/logical-operators/or.js +22 -0
- package/esm/docs/en/docs/create-metrics/maql/maql-and-multidimensionality.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/maql-and-multidimensionality.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/maql-and-multidimensionality.js +59 -0
- package/esm/docs/en/docs/create-metrics/maql/math/abs.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/abs.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/abs.js +23 -0
- package/esm/docs/en/docs/create-metrics/maql/math/arithmetic-operations.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/arithmetic-operations.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/arithmetic-operations.js +29 -0
- package/esm/docs/en/docs/create-metrics/maql/math/ceiling.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/ceiling.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/ceiling.js +21 -0
- package/esm/docs/en/docs/create-metrics/maql/math/exp.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/exp.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/exp.js +27 -0
- package/esm/docs/en/docs/create-metrics/maql/math/floor.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/floor.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/floor.js +21 -0
- package/esm/docs/en/docs/create-metrics/maql/math/greatest.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/greatest.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/greatest.js +13 -0
- package/esm/docs/en/docs/create-metrics/maql/math/least.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/least.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/least.js +13 -0
- package/esm/docs/en/docs/create-metrics/maql/math/ln.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/ln.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/ln.js +33 -0
- package/esm/docs/en/docs/create-metrics/maql/math/log.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/log.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/log.js +29 -0
- package/esm/docs/en/docs/create-metrics/maql/math/power.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/power.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/power.js +33 -0
- package/esm/docs/en/docs/create-metrics/maql/math/round.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/round.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/round.js +34 -0
- package/esm/docs/en/docs/create-metrics/maql/math/sign.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/sign.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/sign.js +30 -0
- package/esm/docs/en/docs/create-metrics/maql/math/sqrt.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/sqrt.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/sqrt.js +32 -0
- package/esm/docs/en/docs/create-metrics/maql/math/trunc.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/math/trunc.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/math/trunc.js +36 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/percentile.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/percentile.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/percentile.js +57 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/rank-variations.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/rank-variations.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/rank-variations.js +90 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-in.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-in.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-in.js +53 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-of.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-of.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-of.js +29 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/within-clause.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/within-clause.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/ranking/within-clause.js +101 -0
- package/esm/docs/en/docs/create-metrics/maql/relational-operators.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/relational-operators.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/relational-operators.js +50 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/rolling-window.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/rolling-window.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/rolling-window.js +71 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-total-statistical-functions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-total-statistical-functions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-total-statistical-functions.js +54 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-totals-for-core-functions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-totals-for-core-functions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-totals-for-core-functions.js +37 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/correl.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/correl.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/correl.js +47 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/covariance-functions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/covariance-functions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/covariance-functions.js +46 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/forecast.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/forecast.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/forecast.js +74 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/least-squares-functions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/least-squares-functions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/least-squares-functions.js +44 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/standard-deviation-functions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/standard-deviation-functions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/standard-deviation-functions.js +88 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/variance-functions.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/variance-functions.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/statistic/variance-functions.js +54 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-each.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-each.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-each.js +96 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-next-period.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-next-period.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-next-period.js +38 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-next.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-next.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-next.js +27 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-previous-period.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-previous-period.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-previous-period.js +26 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-previous.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-previous.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time/for-previous.js +30 -0
- package/esm/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.js +36 -0
- package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.js +53 -0
- package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.js +55 -0
- package/esm/docs/en/docs/create-metrics/maql/time-macros.d.ts +2 -0
- package/esm/docs/en/docs/create-metrics/maql/time-macros.d.ts.map +1 -0
- package/esm/docs/en/docs/create-metrics/maql/time-macros.js +79 -0
- package/esm/docs/index.d.ts +77 -0
- package/esm/docs/index.d.ts.map +1 -0
- package/esm/docs/index.js +141 -0
- package/esm/findObjects.d.ts +13 -0
- package/esm/findObjects.d.ts.map +1 -0
- package/esm/findObjects.js +72 -0
- package/esm/format.d.ts +4 -0
- package/esm/format.d.ts.map +1 -0
- package/esm/format.js +581 -0
- package/esm/highlight/convert.d.ts +3 -0
- package/esm/highlight/convert.d.ts.map +1 -0
- package/esm/highlight/convert.js +12 -0
- package/esm/highlight/semanticsHighlight.d.ts +29 -0
- package/esm/highlight/semanticsHighlight.d.ts.map +1 -0
- package/esm/highlight/semanticsHighlight.js +326 -0
- package/esm/highlight/utils.d.ts +3 -0
- package/esm/highlight/utils.d.ts.map +1 -0
- package/esm/highlight/utils.js +14 -0
- package/esm/hover.d.ts +17 -0
- package/esm/hover.d.ts.map +1 -0
- package/esm/hover.js +60 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +7 -0
- package/esm/labelElements.d.ts +22 -0
- package/esm/labelElements.d.ts.map +1 -0
- package/esm/labelElements.js +225 -0
- package/esm/maqlLanguageService.d.ts +51 -0
- package/esm/maqlLanguageService.d.ts.map +1 -0
- package/esm/maqlLanguageService.js +102 -0
- package/esm/maqlObjectTypes.d.ts +15 -0
- package/esm/maqlObjectTypes.d.ts.map +1 -0
- package/esm/maqlObjectTypes.js +28 -0
- package/esm/maqlServer.d.ts +4 -0
- package/esm/maqlServer.d.ts.map +1 -0
- package/esm/maqlServer.js +78 -0
- package/esm/metadata/model.d.ts +116 -0
- package/esm/metadata/model.d.ts.map +1 -0
- package/esm/metadata/model.js +137 -0
- package/esm/metadata/parameters.d.ts +16 -0
- package/esm/metadata/parameters.d.ts.map +1 -0
- package/esm/metadata/parameters.js +38 -0
- package/esm/metadata/types.d.ts +14 -0
- package/esm/metadata/types.d.ts.map +1 -0
- package/esm/metadata/types.js +2 -0
- package/esm/metadataService.d.ts +50 -0
- package/esm/metadataService.d.ts.map +1 -0
- package/esm/metadataService.js +156 -0
- package/esm/node/main.d.ts +2 -0
- package/esm/node/main.d.ts.map +1 -0
- package/esm/node/main.js +18 -0
- package/esm/parameterConstraints.d.ts +5 -0
- package/esm/parameterConstraints.d.ts.map +1 -0
- package/esm/parameterConstraints.js +198 -0
- package/esm/parseMaql.d.ts +43 -0
- package/esm/parseMaql.d.ts.map +1 -0
- package/esm/parseMaql.js +97 -0
- package/esm/renderParameters.d.ts +33 -0
- package/esm/renderParameters.d.ts.map +1 -0
- package/esm/renderParameters.js +72 -0
- package/esm/tests/metadata.test.helpers.d.ts +8 -0
- package/esm/tests/metadata.test.helpers.d.ts.map +1 -0
- package/esm/tests/metadata.test.helpers.js +468 -0
- package/esm/tokenRanges.d.ts +36 -0
- package/esm/tokenRanges.d.ts.map +1 -0
- package/esm/tokenRanges.js +54 -0
- package/esm/types/hierarchy.d.ts +37 -0
- package/esm/types/hierarchy.d.ts.map +1 -0
- package/esm/types/hierarchy.js +165 -0
- package/esm/types/signatures.d.ts +40 -0
- package/esm/types/signatures.d.ts.map +1 -0
- package/esm/types/signatures.js +142 -0
- package/esm/types/typeChecking.d.ts +56 -0
- package/esm/types/typeChecking.d.ts.map +1 -0
- package/esm/types/typeChecking.js +296 -0
- package/esm/types/typeModel.d.ts +18 -0
- package/esm/types/typeModel.d.ts.map +1 -0
- package/esm/types/typeModel.js +84 -0
- package/package.json +89 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { objectTypeToTigerIdType } from "@gooddata/sdk-backend-tiger";
|
|
3
|
+
import { areObjRefsEqual, } from "@gooddata/sdk-model";
|
|
4
|
+
export function isITigerAttribute(object) {
|
|
5
|
+
return object.tigerType === "attribute";
|
|
6
|
+
}
|
|
7
|
+
export function isITigerLabel(object) {
|
|
8
|
+
return object.tigerType === "label";
|
|
9
|
+
}
|
|
10
|
+
export function isITigerDateLabel(object) {
|
|
11
|
+
return isITigerLabel(object) && object.tigerTypeModifier === "date";
|
|
12
|
+
}
|
|
13
|
+
export function isITigerFact(object) {
|
|
14
|
+
return object.tigerType === "fact";
|
|
15
|
+
}
|
|
16
|
+
export function isITigerMetric(object) {
|
|
17
|
+
return object.tigerType === "metric";
|
|
18
|
+
}
|
|
19
|
+
export function isITigerComputedAttribute(object) {
|
|
20
|
+
return object.tigerType === "computedAttribute";
|
|
21
|
+
}
|
|
22
|
+
export function isITigerParameter(object) {
|
|
23
|
+
return object.tigerType === "parameter";
|
|
24
|
+
}
|
|
25
|
+
export class LdmObjects {
|
|
26
|
+
attributes;
|
|
27
|
+
labels;
|
|
28
|
+
facts;
|
|
29
|
+
metrics;
|
|
30
|
+
computedAttributes;
|
|
31
|
+
parameters;
|
|
32
|
+
datasets;
|
|
33
|
+
size;
|
|
34
|
+
constructor(attributes, facts, metrics, parameters, dates, datasets, computedAttributes = []) {
|
|
35
|
+
const processedAttributes = this.processAttributes(attributes);
|
|
36
|
+
const processedDates = this.processDates(dates);
|
|
37
|
+
const regularAttributes = processedAttributes.flatMap((item) => item.attributes);
|
|
38
|
+
const dateAttributes = processedDates.flatMap((item) => item.attributes);
|
|
39
|
+
this.attributes = {
|
|
40
|
+
regular: regularAttributes,
|
|
41
|
+
date: dateAttributes,
|
|
42
|
+
all: regularAttributes.concat(dateAttributes),
|
|
43
|
+
};
|
|
44
|
+
const regularLabels = processedAttributes.flatMap((item) => item.labels);
|
|
45
|
+
const dateLabels = processedDates.flatMap((item) => item.labels);
|
|
46
|
+
this.labels = {
|
|
47
|
+
regular: regularLabels,
|
|
48
|
+
date: dateLabels,
|
|
49
|
+
all: regularLabels.concat(dateLabels),
|
|
50
|
+
};
|
|
51
|
+
this.facts = facts.map((fact) => LdmObjects.toTigerMetadataObject(fact.fact));
|
|
52
|
+
this.metrics = metrics.map((metric) => LdmObjects.toTigerMetadataObject(metric.measure));
|
|
53
|
+
this.computedAttributes = computedAttributes.map((computedAttribute) => LdmObjects.toTigerMetadataObject(computedAttribute));
|
|
54
|
+
this.parameters = parameters.map((parameter) => LdmObjects.toTigerMetadataObject(parameter));
|
|
55
|
+
this.datasets = datasets.map((dataset) => LdmObjects.toTigerDataset(dataset));
|
|
56
|
+
this.size =
|
|
57
|
+
this.attributes.all.length +
|
|
58
|
+
this.labels.all.length +
|
|
59
|
+
this.facts.length +
|
|
60
|
+
this.metrics.length +
|
|
61
|
+
this.computedAttributes.length +
|
|
62
|
+
this.parameters.length;
|
|
63
|
+
}
|
|
64
|
+
get(type, typeModifier = "all") {
|
|
65
|
+
switch (type) {
|
|
66
|
+
case "attribute":
|
|
67
|
+
return this.attributes[typeModifier];
|
|
68
|
+
case "fact":
|
|
69
|
+
return this.facts;
|
|
70
|
+
case "metric":
|
|
71
|
+
return this.metrics;
|
|
72
|
+
case "computedAttribute":
|
|
73
|
+
return this.computedAttributes;
|
|
74
|
+
case "parameter":
|
|
75
|
+
return this.parameters;
|
|
76
|
+
case "dataset":
|
|
77
|
+
return this.datasets;
|
|
78
|
+
case "label":
|
|
79
|
+
return this.labels[typeModifier];
|
|
80
|
+
default:
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
findObject(object) {
|
|
85
|
+
if (!object.tigerType) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
const objects = this.get(object.tigerType);
|
|
89
|
+
return objects?.find((tigerObject) => areObjRefsEqual(tigerObject.ref, object.ref));
|
|
90
|
+
}
|
|
91
|
+
findById(type, id) {
|
|
92
|
+
return this.get(type)?.find((object) => object.id === id);
|
|
93
|
+
}
|
|
94
|
+
processAttributes(attributes) {
|
|
95
|
+
return attributes.flatMap((attribute) => ({
|
|
96
|
+
attributes: [LdmObjects.toTigerMetadataObject(attribute.attribute)],
|
|
97
|
+
labels: attribute.displayForms.flatMap((label) => LdmObjects.toTigerMetadataObject(label)),
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
processDates(dates) {
|
|
101
|
+
return dates.flatMap((date) => ({
|
|
102
|
+
attributes: dates.flatMap((date) => date.dateAttributes.map((attr) => ({
|
|
103
|
+
tigerTypeModifier: "date",
|
|
104
|
+
granularity: attr.granularity,
|
|
105
|
+
...LdmObjects.toTigerMetadataObject(attr.attribute),
|
|
106
|
+
}))),
|
|
107
|
+
labels: date.dateAttributes.flatMap((dateAttr) => dateAttr.attribute.displayForms.map((label) => ({
|
|
108
|
+
tigerTypeModifier: "date",
|
|
109
|
+
granularity: dateAttr.granularity,
|
|
110
|
+
...LdmObjects.toTigerMetadataObject(label),
|
|
111
|
+
}))),
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
static toTigerMetadataObject(metadataObject) {
|
|
115
|
+
return {
|
|
116
|
+
tigerType: objectTypeToTigerIdType[metadataObject.type],
|
|
117
|
+
...metadataObject,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static toTigerDataset(dataset) {
|
|
121
|
+
return {
|
|
122
|
+
type: "dataSet",
|
|
123
|
+
tigerType: "dataset",
|
|
124
|
+
id: dataset.id,
|
|
125
|
+
title: dataset.title,
|
|
126
|
+
description: dataset.description || "",
|
|
127
|
+
deprecated: false,
|
|
128
|
+
production: true,
|
|
129
|
+
ref: {
|
|
130
|
+
type: "dataSet",
|
|
131
|
+
identifier: dataset.id,
|
|
132
|
+
},
|
|
133
|
+
unlisted: false,
|
|
134
|
+
uri: "",
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type IParameterDefinition } from "@gooddata/sdk-model";
|
|
2
|
+
export declare function parameterTypeLabel(definition: IParameterDefinition): string;
|
|
3
|
+
export declare function parameterDefaultLabel(definition: IParameterDefinition): string;
|
|
4
|
+
export declare function parameterSummary(definition: IParameterDefinition): string;
|
|
5
|
+
/**
|
|
6
|
+
* Whether a definition describes a default that can be written into MAQL. A parameter file being
|
|
7
|
+
* edited reaches us with a type it has not finished, or a default of the wrong kind for the type it
|
|
8
|
+
* declares, neither of which the declared type admits.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isRenderableDefinition(definition: unknown): definition is IParameterDefinition;
|
|
11
|
+
/**
|
|
12
|
+
* The parameter's default as it would be written in MAQL: string defaults quoted and escaped,
|
|
13
|
+
* numeric ones bare.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parameterMaqlLiteral(definition: IParameterDefinition): string;
|
|
16
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/metadata/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,oBAAoB,EAA+B,MAAM,qBAAqB,CAAC;AAI7F,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAE3E;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAE9E;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,oBAAoB,CAU9F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAI7E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import MaqlPkg from "@gooddata/maql-antlr4ts";
|
|
3
|
+
import { isStringParameterDefinition } from "@gooddata/sdk-model";
|
|
4
|
+
const { escapeString } = MaqlPkg;
|
|
5
|
+
export function parameterTypeLabel(definition) {
|
|
6
|
+
return definition.type.toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
export function parameterDefaultLabel(definition) {
|
|
9
|
+
return JSON.stringify(definition.defaultValue);
|
|
10
|
+
}
|
|
11
|
+
export function parameterSummary(definition) {
|
|
12
|
+
return `${parameterTypeLabel(definition)}, default: ${parameterDefaultLabel(definition)}`;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Whether a definition describes a default that can be written into MAQL. A parameter file being
|
|
16
|
+
* edited reaches us with a type it has not finished, or a default of the wrong kind for the type it
|
|
17
|
+
* declares, neither of which the declared type admits.
|
|
18
|
+
*/
|
|
19
|
+
export function isRenderableDefinition(definition) {
|
|
20
|
+
const candidate = definition;
|
|
21
|
+
switch (candidate?.type) {
|
|
22
|
+
case "STRING":
|
|
23
|
+
return typeof candidate.defaultValue === "string";
|
|
24
|
+
case "NUMBER":
|
|
25
|
+
return typeof candidate.defaultValue === "number";
|
|
26
|
+
default:
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The parameter's default as it would be written in MAQL: string defaults quoted and escaped,
|
|
32
|
+
* numeric ones bare.
|
|
33
|
+
*/
|
|
34
|
+
export function parameterMaqlLiteral(definition) {
|
|
35
|
+
return isStringParameterDefinition(definition)
|
|
36
|
+
? escapeString(definition.defaultValue, '"')
|
|
37
|
+
: String(definition.defaultValue);
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IAttributeOrMeasure } from "@gooddata/sdk-model";
|
|
2
|
+
import { type LabelElementsFunc, type LdmObjects } from "./model.js";
|
|
3
|
+
/**
|
|
4
|
+
* Interface to connect to Metadata API
|
|
5
|
+
* Internals do not matter for the service, only needed is the fact that
|
|
6
|
+
* the language service can asynchronously get typed identifiers and that it is able
|
|
7
|
+
* to force a refresh of the stored model
|
|
8
|
+
*/
|
|
9
|
+
export interface IMetadataInterface {
|
|
10
|
+
updateModel(): void;
|
|
11
|
+
getLdmObjects(items?: IAttributeOrMeasure[]): Promise<LdmObjects>;
|
|
12
|
+
getLabelElementsFunction(): Promise<LabelElementsFunc>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/metadata/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,WAAW,IAAI,IAAI,CAAC;IAEpB,aAAa,CAAC,KAAK,CAAC,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAElE,wBAAwB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type IAttributeOrMeasure } from "@gooddata/sdk-model";
|
|
3
|
+
import { type LabelElementsFunc, LdmObjects } from "./metadata/model.js";
|
|
4
|
+
import { type IMetadataInterface } from "./metadata/types.js";
|
|
5
|
+
export interface IMetadataServiceOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Resolved value of the enableComputedAttributes workspace setting. The computed-attributes
|
|
8
|
+
* catalog listing is gated by it on the backend, so when the host knows the setting is off the
|
|
9
|
+
* service does not request the type at all. Leave undefined when the setting is unknown: the
|
|
10
|
+
* service then requests computed attributes and degrades to the default type set on refusal.
|
|
11
|
+
*/
|
|
12
|
+
enableComputedAttributes?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class MetadataService implements IMetadataInterface {
|
|
15
|
+
readonly workspaceId: string;
|
|
16
|
+
readonly backend: IAnalyticalBackend;
|
|
17
|
+
private readonly options;
|
|
18
|
+
private catalog?;
|
|
19
|
+
private ldmObjects;
|
|
20
|
+
private datasets;
|
|
21
|
+
private parameters;
|
|
22
|
+
/**
|
|
23
|
+
* The only construction path: the service runs on the backend injected by the host — the same
|
|
24
|
+
* instance (auth provider, caches and all) every other consumer of the host uses.
|
|
25
|
+
*/
|
|
26
|
+
static withBackend(workspaceId: string, backend: IAnalyticalBackend, options?: IMetadataServiceOptions): MetadataService;
|
|
27
|
+
private constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Gets all objects (facts, metrics, attributes and labels) from the
|
|
30
|
+
* declarative model retrieved from Metadata API.
|
|
31
|
+
*/
|
|
32
|
+
getLdmObjects(items?: IAttributeOrMeasure[]): Promise<LdmObjects>;
|
|
33
|
+
/**
|
|
34
|
+
* Makes a new request to Metadata API for an updated declarative model.
|
|
35
|
+
* Refreshes stored objects from the received model.
|
|
36
|
+
*/
|
|
37
|
+
updateModel(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Makes a request to Catalog API to slice datasets for
|
|
40
|
+
* available items; doesn't update model with fresh data!
|
|
41
|
+
* Only updates ldmObjects.
|
|
42
|
+
*/
|
|
43
|
+
sliceModel(items: IAttributeOrMeasure[]): Promise<LdmObjects>;
|
|
44
|
+
private getWholeCatalog;
|
|
45
|
+
/**
|
|
46
|
+
* Returns a function to later retrieve label elements
|
|
47
|
+
*/
|
|
48
|
+
getLabelElementsFunction(): Promise<LabelElementsFunc>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=metadataService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadataService.d.ts","sourceRoot":"","sources":["../src/metadataService.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,kBAAkB,EAI1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEH,KAAK,mBAAmB,EAE3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIH,KAAK,iBAAiB,EACtB,UAAU,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACpC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED,qBAAa,eAAgB,YAAW,kBAAkB;IAmBlD,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC5B,QAAQ,CAAC,OAAO,EAAE,kBAAkB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO;IApB5B,OAAO,CAAC,OAAO,CAAC,CAAoB;IACpC,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,UAAU,CAAkC;IAEpD;;;OAGG;IACH,OAAc,WAAW,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE,uBAA4B,mBAGxC;IAED,OAAO,eASN;IAED;;;OAGG;IACU,aAAa,CAAC,KAAK,CAAC,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;IAED;;;OAGG;IACI,WAAW,IAAI,IAAI,CAEzB;IAED;;;;OAIG;IACI,UAAU,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAqBnE;YAEa,eAAe;IAkE7B;;OAEG;IACI,wBAAwB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAgD5D;CACJ"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { DefaultWorkspaceCatalogTypes, } from "@gooddata/sdk-backend-spi";
|
|
3
|
+
import { LdmObjects, } from "./metadata/model.js";
|
|
4
|
+
export class MetadataService {
|
|
5
|
+
workspaceId;
|
|
6
|
+
backend;
|
|
7
|
+
options;
|
|
8
|
+
catalog; // holds the entire unprocessed catalog
|
|
9
|
+
ldmObjects; // LDM objects holds latest parsed objects to be used further
|
|
10
|
+
datasets = [];
|
|
11
|
+
parameters = [];
|
|
12
|
+
/**
|
|
13
|
+
* The only construction path: the service runs on the backend injected by the host — the same
|
|
14
|
+
* instance (auth provider, caches and all) every other consumer of the host uses.
|
|
15
|
+
*/
|
|
16
|
+
static withBackend(workspaceId, backend, options = {}) {
|
|
17
|
+
return new MetadataService(workspaceId, backend, options);
|
|
18
|
+
}
|
|
19
|
+
constructor(workspaceId, backend, options) {
|
|
20
|
+
this.workspaceId = workspaceId;
|
|
21
|
+
this.backend = backend;
|
|
22
|
+
this.options = options;
|
|
23
|
+
this.catalog = undefined;
|
|
24
|
+
this.ldmObjects = this.getWholeCatalog();
|
|
25
|
+
this.sliceModel = this.sliceModel.bind(this);
|
|
26
|
+
this.getLdmObjects = this.getLdmObjects.bind(this);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets all objects (facts, metrics, attributes and labels) from the
|
|
30
|
+
* declarative model retrieved from Metadata API.
|
|
31
|
+
*/
|
|
32
|
+
async getLdmObjects(items) {
|
|
33
|
+
return items && items.length > 0 ? this.sliceModel(items) : this.ldmObjects;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Makes a new request to Metadata API for an updated declarative model.
|
|
37
|
+
* Refreshes stored objects from the received model.
|
|
38
|
+
*/
|
|
39
|
+
updateModel() {
|
|
40
|
+
this.ldmObjects = this.getWholeCatalog();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Makes a request to Catalog API to slice datasets for
|
|
44
|
+
* available items; doesn't update model with fresh data!
|
|
45
|
+
* Only updates ldmObjects.
|
|
46
|
+
*/
|
|
47
|
+
sliceModel(items) {
|
|
48
|
+
if (!this.catalog || items.length === 0) {
|
|
49
|
+
return this.ldmObjects;
|
|
50
|
+
}
|
|
51
|
+
return this.catalog
|
|
52
|
+
.availableItems()
|
|
53
|
+
.forItems(items)
|
|
54
|
+
.load()
|
|
55
|
+
.then((catalog) => {
|
|
56
|
+
return new LdmObjects(catalog.availableAttributes(), catalog.availableFacts(), catalog.availableMeasures(), this.parameters, catalog.availableDateDatasets(), this.datasets, catalog.availableComputedAttributes().map((item) => item.computedAttribute));
|
|
57
|
+
// TODO: Handling errors (when nothing is found, etc.)
|
|
58
|
+
})
|
|
59
|
+
.catch(() => this.ldmObjects);
|
|
60
|
+
}
|
|
61
|
+
async getWholeCatalog() {
|
|
62
|
+
// Origin ALL includes the datasets inherited from parent workspaces. Completion lists the
|
|
63
|
+
// NORMAL and AUXILIARY datasets; date datasets come from the catalog. A backend without the
|
|
64
|
+
// service throws synchronously, and a failed listing removes only the dataset completion.
|
|
65
|
+
const listDatasets = (dataSetType) => this.backend
|
|
66
|
+
.workspace(this.workspaceId)
|
|
67
|
+
.datasets()
|
|
68
|
+
.getDatasetsQuery()
|
|
69
|
+
.withOrigin("ALL")
|
|
70
|
+
.withFilter({ dataSetType })
|
|
71
|
+
.withSize(1000)
|
|
72
|
+
.query()
|
|
73
|
+
.then((result) => result.all());
|
|
74
|
+
const datasetsPromise = Promise.resolve()
|
|
75
|
+
.then(() => Promise.all([listDatasets("NORMAL"), listDatasets("AUXILIARY")]))
|
|
76
|
+
.then((lists) => lists.flat())
|
|
77
|
+
.catch(() => []);
|
|
78
|
+
const parametersPromise = this.backend
|
|
79
|
+
.workspace(this.workspaceId)
|
|
80
|
+
.parameters()
|
|
81
|
+
.getParametersQuery()
|
|
82
|
+
.withSize(2000)
|
|
83
|
+
.query()
|
|
84
|
+
.then((result) => result.all())
|
|
85
|
+
.catch(() => []);
|
|
86
|
+
// Computed attributes are opt-in on the catalog, so the default type set must be requested
|
|
87
|
+
// alongside them; the requested types also drive what availableItems() (used by
|
|
88
|
+
// sliceModel) asks the backend to validate. The listing is gated by the
|
|
89
|
+
// enableComputedAttributes setting: when the host resolved it as off, skip the request
|
|
90
|
+
// entirely (the backend would refuse it with a 400 logged to the console). Otherwise a
|
|
91
|
+
// backend can still reject it (setting race, older backend), and a single rejected loader
|
|
92
|
+
// fails the whole catalog load - fall back to the default type set rather than losing
|
|
93
|
+
// completion and validation entirely.
|
|
94
|
+
const catalogFactory = this.backend.workspace(this.workspaceId).catalog();
|
|
95
|
+
const catalogPromise = this.options.enableComputedAttributes === false
|
|
96
|
+
? catalogFactory.load()
|
|
97
|
+
: catalogFactory
|
|
98
|
+
.forTypes([...DefaultWorkspaceCatalogTypes, "computedAttribute"])
|
|
99
|
+
.load()
|
|
100
|
+
.catch(() => catalogFactory.load());
|
|
101
|
+
const [datasets, catalog, parameters] = await Promise.all([
|
|
102
|
+
datasetsPromise,
|
|
103
|
+
catalogPromise,
|
|
104
|
+
parametersPromise,
|
|
105
|
+
]);
|
|
106
|
+
this.datasets = datasets;
|
|
107
|
+
this.catalog = catalog;
|
|
108
|
+
this.parameters = parameters;
|
|
109
|
+
return new LdmObjects(catalog.attributes(), catalog.facts(), catalog.measures(), parameters, catalog.dateDatasets(), this.datasets, catalog.computedAttributes().map((item) => item.computedAttribute));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Returns a function to later retrieve label elements
|
|
113
|
+
*/
|
|
114
|
+
getLabelElementsFunction() {
|
|
115
|
+
const queryFactory = this.backend.workspace(this.workspaceId).attributes().elements();
|
|
116
|
+
return Promise.resolve(async (labels, excluded, options, limit, offset) => {
|
|
117
|
+
const settled = await Promise.allSettled(labels.map((label) => {
|
|
118
|
+
let query = queryFactory.forDisplayForm(label.ref).withOptions(options);
|
|
119
|
+
if (limit)
|
|
120
|
+
query = query.withLimit(limit);
|
|
121
|
+
if (offset)
|
|
122
|
+
query = query.withOffset(offset);
|
|
123
|
+
return query.query();
|
|
124
|
+
}));
|
|
125
|
+
const rejected = [];
|
|
126
|
+
const rejectionReasons = new Map();
|
|
127
|
+
const results = settled
|
|
128
|
+
.map((result, idx) => {
|
|
129
|
+
if (result.status === "fulfilled") {
|
|
130
|
+
return result.value;
|
|
131
|
+
}
|
|
132
|
+
else if (result.status === "rejected") {
|
|
133
|
+
rejected.push(labels[idx]);
|
|
134
|
+
rejectionReasons.set(labels[idx], result.reason);
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
})
|
|
138
|
+
.filter((elements) => !!elements);
|
|
139
|
+
const elements = results
|
|
140
|
+
.map((result) => result.items)
|
|
141
|
+
.flat()
|
|
142
|
+
.filter((element) => element.title === null || !excluded.includes(element.title)); // Filter out already typed strings
|
|
143
|
+
const isIncomplete = results
|
|
144
|
+
.map((result) => result.offset + result.limit < result.totalCount)
|
|
145
|
+
.reduce((prev, curr) => prev || curr, false);
|
|
146
|
+
return {
|
|
147
|
+
list: {
|
|
148
|
+
elements: elements,
|
|
149
|
+
isIncomplete: isIncomplete,
|
|
150
|
+
},
|
|
151
|
+
rejected: rejected,
|
|
152
|
+
rejectionReasons: rejectionReasons,
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":""}
|
package/esm/node/main.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import * as process from "process";
|
|
3
|
+
import { ProposedFeatures, createConnection } from "vscode-languageserver/node.js";
|
|
4
|
+
import { TigerTokenAuthProvider, tigerFactory } from "@gooddata/sdk-backend-tiger";
|
|
5
|
+
import { startServer } from "../maqlServer.js";
|
|
6
|
+
import { MetadataService } from "../metadataService.js";
|
|
7
|
+
const connection = createConnection(ProposedFeatures.all);
|
|
8
|
+
connection.tracer.log("Connected to the MAQL language server");
|
|
9
|
+
const endpoint = process.env["TIGER_ENDPOINT"] ?? "http://localhost:3000";
|
|
10
|
+
const workspaceId = process.env["TIGER_WORKSPACE_ID"] ?? "demo";
|
|
11
|
+
const apiToken = process.env["TIGER_API_TOKEN"] ?? "YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz";
|
|
12
|
+
// The standalone Node entry is its own host, so building a backend here is legitimate — this is
|
|
13
|
+
// the one place in the package that owns authentication.
|
|
14
|
+
const backend = tigerFactory(undefined, { packageName: "@gooddata/sdk-maql-language-server" })
|
|
15
|
+
.onHostname(endpoint)
|
|
16
|
+
.withAuthentication(new TigerTokenAuthProvider(apiToken));
|
|
17
|
+
const metadataService = MetadataService.withBackend(workspaceId, backend);
|
|
18
|
+
startServer(connection, metadataService);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Diagnostic } from "vscode-languageserver";
|
|
2
|
+
import { type LdmObjects } from "./metadata/model.js";
|
|
3
|
+
import { type MaqlMetric } from "./parseMaql.js";
|
|
4
|
+
export declare function validateParameterConstraints(metric: MaqlMetric, ldmObjects: LdmObjects): Diagnostic[];
|
|
5
|
+
//# sourceMappingURL=parameterConstraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameterConstraints.d.ts","sourceRoot":"","sources":["../src/parameterConstraints.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAkC,MAAM,uBAAuB,CAAC;AAcnF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,UAAU,EAAE,CAarG"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { groupBy } from "lodash-es";
|
|
3
|
+
import { Diagnostic, DiagnosticSeverity } from "vscode-languageserver";
|
|
4
|
+
import MaqlPkg from "@gooddata/maql-antlr4ts";
|
|
5
|
+
const { MaqlLexer } = MaqlPkg;
|
|
6
|
+
import { isStringParameterDefinition } from "@gooddata/sdk-model";
|
|
7
|
+
import { ErrorCodes, diagnosticsSource } from "./constants.js";
|
|
8
|
+
import { AntlrRange, tokenRange } from "./tokenRanges.js";
|
|
9
|
+
export function validateParameterConstraints(metric, ldmObjects) {
|
|
10
|
+
const hasConstrainedParameter = ldmObjects
|
|
11
|
+
.get("parameter")
|
|
12
|
+
.some((parameter) => isStringParameterDefinition(parameter.definition) &&
|
|
13
|
+
parameter.definition.constraints?.allowedValues?.length);
|
|
14
|
+
if (!hasConstrainedParameter) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const caseNodes = findCaseNodes(metric.ast);
|
|
18
|
+
return caseNodes.flatMap((caseNode) => validateCase(caseNode, metric, ldmObjects));
|
|
19
|
+
}
|
|
20
|
+
function validateCase(caseNode, metric, ldmObjects) {
|
|
21
|
+
const { pairs, otherUse } = collectParameterUsage(caseNode);
|
|
22
|
+
const anchor = keywordRange(caseNode, metric);
|
|
23
|
+
const diagnostics = [];
|
|
24
|
+
for (const [parameterId, parameterPairs] of Object.entries(groupBy(pairs, (pair) => pair.parameterId))) {
|
|
25
|
+
const allowedValues = allowedValuesOf(parameterId, ldmObjects);
|
|
26
|
+
if (!allowedValues) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
for (const pair of parameterPairs) {
|
|
30
|
+
const notAllowed = notAllowedDiagnostic(pair, allowedValues);
|
|
31
|
+
if (notAllowed) {
|
|
32
|
+
diagnostics.push(notAllowed);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!anchor || otherUse.has(parameterId)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const covered = parameterPairs.map((pair) => pair.literal.value);
|
|
39
|
+
const uncovered = allowedValues.filter((value) => !covered.includes(value));
|
|
40
|
+
if (uncovered.length > 0) {
|
|
41
|
+
diagnostics.push(uncoveredDiagnostic(parameterId, uncovered, anchor));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return diagnostics;
|
|
45
|
+
}
|
|
46
|
+
function collectParameterUsage(caseNode) {
|
|
47
|
+
const usage = { pairs: [], otherUse: new Set() };
|
|
48
|
+
for (const branch of caseNode.branches) {
|
|
49
|
+
if (!isConditionalNode(branch)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const purePairs = pureEqualityPairs(branch.condition);
|
|
53
|
+
if (purePairs) {
|
|
54
|
+
usage.pairs.push(...purePairs);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
collectFromCondition(branch.condition, usage);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return usage;
|
|
61
|
+
}
|
|
62
|
+
function pureEqualityPairs(condition) {
|
|
63
|
+
if (isParenthesizedNode(condition)) {
|
|
64
|
+
const [inner] = condition.content;
|
|
65
|
+
return inner && condition.content.length === 1 ? pureEqualityPairs(inner) : undefined;
|
|
66
|
+
}
|
|
67
|
+
if (isEqualityNode(condition)) {
|
|
68
|
+
const pair = asParameterEquality(condition);
|
|
69
|
+
return pair ? [pair] : undefined;
|
|
70
|
+
}
|
|
71
|
+
if (isDisjunctionNode(condition)) {
|
|
72
|
+
const childPairs = [];
|
|
73
|
+
for (const child of condition.content) {
|
|
74
|
+
const pairs = pureEqualityPairs(child);
|
|
75
|
+
if (!pairs) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
childPairs.push(...pairs);
|
|
79
|
+
}
|
|
80
|
+
const [first, ...rest] = childPairs;
|
|
81
|
+
return first && rest.every((pair) => pair.parameterId === first.parameterId) ? childPairs : undefined;
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
function collectFromCondition(node, usage) {
|
|
86
|
+
if (isCaseNode(node)) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (isNegationNode(node)) {
|
|
90
|
+
for (const child of node.content) {
|
|
91
|
+
collectOpaqueUse(child, usage);
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (isEqualityNode(node)) {
|
|
96
|
+
const pair = asParameterEquality(node);
|
|
97
|
+
if (pair) {
|
|
98
|
+
usage.pairs.push(pair);
|
|
99
|
+
usage.otherUse.add(pair.parameterId);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const parameter = parameterIdentifierOf(node);
|
|
104
|
+
if (parameter) {
|
|
105
|
+
usage.otherUse.add(parameter.id);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
for (const child of node.content) {
|
|
109
|
+
collectFromCondition(child, usage);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function collectOpaqueUse(node, usage) {
|
|
113
|
+
if (isCaseNode(node)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const parameter = parameterIdentifierOf(node);
|
|
117
|
+
if (parameter) {
|
|
118
|
+
usage.otherUse.add(parameter.id);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
for (const child of node.content) {
|
|
122
|
+
collectOpaqueUse(child, usage);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function asParameterEquality(node) {
|
|
126
|
+
if (node.content.length !== 2) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
const [left, right] = node.content;
|
|
130
|
+
const parameter = parameterIdentifierOf(left) ?? parameterIdentifierOf(right);
|
|
131
|
+
const literal = [left, right].find(isStringLiteralNode);
|
|
132
|
+
return parameter && literal ? { parameterId: parameter.id, literal } : undefined;
|
|
133
|
+
}
|
|
134
|
+
function parameterIdentifierOf(node) {
|
|
135
|
+
return isIdentifierNode(node) && node.objectType === "parameter" ? node : undefined;
|
|
136
|
+
}
|
|
137
|
+
function keywordRange(caseNode, metric) {
|
|
138
|
+
const astRange = caseNode.range;
|
|
139
|
+
if (!astRange) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const token = metric.tokenStream
|
|
143
|
+
.getTokens()
|
|
144
|
+
.find((candidate) => candidate.line - 1 === astRange.start.line &&
|
|
145
|
+
candidate.charPositionInLine === astRange.start.character &&
|
|
146
|
+
(candidate.type === MaqlLexer.CASE || candidate.type === MaqlLexer.IF));
|
|
147
|
+
return token ? tokenRange(token) : undefined;
|
|
148
|
+
}
|
|
149
|
+
function allowedValuesOf(parameterId, ldmObjects) {
|
|
150
|
+
const parameter = ldmObjects.get("parameter").find((candidate) => candidate.id === parameterId);
|
|
151
|
+
if (!parameter || !isStringParameterDefinition(parameter.definition)) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
const allowedValues = parameter.definition.constraints?.allowedValues;
|
|
155
|
+
return allowedValues?.length ? allowedValues.map((allowed) => allowed.value) : undefined;
|
|
156
|
+
}
|
|
157
|
+
function notAllowedDiagnostic(pair, allowedValues) {
|
|
158
|
+
if (!pair.literal.range || allowedValues.includes(pair.literal.value)) {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
return Diagnostic.create(AntlrRange.fromAstRange(pair.literal.range).toRange(), `"${pair.literal.value}" is not an allowed value of parameter '${pair.parameterId}' ` +
|
|
162
|
+
`(allowed: ${quoteValues(allowedValues)}) — this comparison can never match`, DiagnosticSeverity.Warning, ErrorCodes.ParameterValueNotAllowed, diagnosticsSource);
|
|
163
|
+
}
|
|
164
|
+
function uncoveredDiagnostic(parameterId, uncovered, anchor) {
|
|
165
|
+
return Diagnostic.create(anchor, `parameter '${parameterId}': allowed values ${quoteValues(uncovered)} ` +
|
|
166
|
+
"have no matching branch — they fall through to ELSE/NULL", DiagnosticSeverity.Information, ErrorCodes.ParameterValueUncovered, diagnosticsSource);
|
|
167
|
+
}
|
|
168
|
+
function quoteValues(allowedValues) {
|
|
169
|
+
return allowedValues.map((value) => `"${value}"`).join(", ");
|
|
170
|
+
}
|
|
171
|
+
function isCaseNode(node) {
|
|
172
|
+
return node.type === "case";
|
|
173
|
+
}
|
|
174
|
+
function isConditionalNode(node) {
|
|
175
|
+
return node.type === "when";
|
|
176
|
+
}
|
|
177
|
+
function isEqualityNode(node) {
|
|
178
|
+
return node.type === "=";
|
|
179
|
+
}
|
|
180
|
+
function isNegationNode(node) {
|
|
181
|
+
return node.type === "not";
|
|
182
|
+
}
|
|
183
|
+
function isDisjunctionNode(node) {
|
|
184
|
+
return node.type === "or";
|
|
185
|
+
}
|
|
186
|
+
function isParenthesizedNode(node) {
|
|
187
|
+
return node.type === "()";
|
|
188
|
+
}
|
|
189
|
+
function isIdentifierNode(node) {
|
|
190
|
+
return node.type === "identifier" || node.type === "raw identifier";
|
|
191
|
+
}
|
|
192
|
+
function isStringLiteralNode(node) {
|
|
193
|
+
return node.type === "string";
|
|
194
|
+
}
|
|
195
|
+
function findCaseNodes(node) {
|
|
196
|
+
const nested = node.content.flatMap(findCaseNodes);
|
|
197
|
+
return isCaseNode(node) ? [node, ...nested] : nested;
|
|
198
|
+
}
|