@gooddata/sdk-maql-language-server 0.0.0-stage → 11.65.0-alpha.10
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 +289 -0
- package/esm/completions/findContext.d.ts +19 -0
- package/esm/completions/findContext.d.ts.map +1 -0
- package/esm/completions/findContext.js +171 -0
- package/esm/completions/functionDescriptions.d.ts +3 -0
- package/esm/completions/functionDescriptions.d.ts.map +1 -0
- package/esm/completions/functionDescriptions.js +98 -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 +46 -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 +259 -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 +82 -0
- package/esm/docs/index.d.ts.map +1 -0
- package/esm/docs/index.js +143 -0
- package/esm/findObjects.d.ts +13 -0
- package/esm/findObjects.d.ts.map +1 -0
- package/esm/findObjects.js +73 -0
- package/esm/format.d.ts +4 -0
- package/esm/format.d.ts.map +1 -0
- package/esm/format.js +569 -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 +47 -0
- package/esm/highlight/semanticsHighlight.d.ts.map +1 -0
- package/esm/highlight/semanticsHighlight.js +345 -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 +23 -0
- package/esm/hover.d.ts.map +1 -0
- package/esm/hover.js +60 -0
- package/esm/index.d.ts +11 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +9 -0
- package/esm/labelElements.d.ts +22 -0
- package/esm/labelElements.d.ts.map +1 -0
- package/esm/labelElements.js +224 -0
- package/esm/maqlLanguageService.d.ts +56 -0
- package/esm/maqlLanguageService.d.ts.map +1 -0
- package/esm/maqlLanguageService.js +104 -0
- package/esm/maqlObjectTypes.d.ts +17 -0
- package/esm/maqlObjectTypes.d.ts.map +1 -0
- package/esm/maqlObjectTypes.js +30 -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 +162 -0
- package/esm/metadata/model.d.ts.map +1 -0
- package/esm/metadata/model.js +143 -0
- package/esm/metadata/parameters.d.ts +16 -0
- package/esm/metadata/parameters.d.ts.map +1 -0
- package/esm/metadata/parameters.js +37 -0
- package/esm/metadata/types.d.ts +16 -0
- package/esm/metadata/types.d.ts.map +1 -0
- package/esm/metadata/types.js +2 -0
- package/esm/metadataService.d.ts +56 -0
- package/esm/metadataService.d.ts.map +1 -0
- package/esm/metadataService.js +159 -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 +197 -0
- package/esm/parseMaql.d.ts +43 -0
- package/esm/parseMaql.d.ts.map +1 -0
- package/esm/parseMaql.js +96 -0
- package/esm/renderParameters.d.ts +41 -0
- package/esm/renderParameters.d.ts.map +1 -0
- package/esm/renderParameters.js +76 -0
- package/esm/sdk-maql-language-server.d.ts +496 -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 +55 -0
- package/esm/tsdoc-metadata.json +11 -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 +141 -0
- package/esm/types/typeChecking.d.ts +54 -0
- package/esm/types/typeChecking.d.ts.map +1 -0
- package/esm/types/typeChecking.js +295 -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 +83 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type IElementsQueryOptions } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type TigerObjectType } from "@gooddata/sdk-backend-tiger";
|
|
3
|
+
import { type DateAttributeGranularity, type IAttributeDisplayFormMetadataObject, type IAttributeElement, type IAttributeMetadataObject, type ICatalogAttribute, type ICatalogDateDataset, type ICatalogFact, type ICatalogMeasure, type IComputedAttributeMetadataObject, type IFactMetadataObject, type IMeasureMetadataObject, type IMetadataObject, type IParameterMetadataObject } from "@gooddata/sdk-model";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface ITigerMetadataObject extends IMetadataObject {
|
|
8
|
+
tigerType: TigerObjectType;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export type ITigerMetadataObjectStub = Pick<ITigerMetadataObject, "id" | "ref"> & Partial<ITigerMetadataObject>;
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export interface ITigerAttribute extends IAttributeMetadataObject, ITigerMetadataObject {
|
|
18
|
+
type: "attribute";
|
|
19
|
+
tigerType: "attribute";
|
|
20
|
+
tigerTypeModifier?: "date";
|
|
21
|
+
granularity?: DateAttributeGranularity;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export interface ITigerLabel extends IAttributeDisplayFormMetadataObject, ITigerMetadataObject {
|
|
27
|
+
type: "displayForm";
|
|
28
|
+
tigerType: "label";
|
|
29
|
+
tigerTypeModifier?: "date";
|
|
30
|
+
granularity?: DateAttributeGranularity;
|
|
31
|
+
}
|
|
32
|
+
export interface ITigerDateLabel extends ITigerLabel {
|
|
33
|
+
tigerTypeModifier: "date";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export interface ITigerFact extends IFactMetadataObject, ITigerMetadataObject {
|
|
39
|
+
type: "fact";
|
|
40
|
+
tigerType: "fact";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export interface ITigerDataset extends ITigerMetadataObject {
|
|
46
|
+
type: "dataSet";
|
|
47
|
+
tigerType: "dataset";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export interface ITigerMetric extends IMeasureMetadataObject, ITigerMetadataObject {
|
|
53
|
+
type: "measure";
|
|
54
|
+
tigerType: "metric";
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A computed attribute is referenced from MAQL by its own type rather than through a label - it has
|
|
58
|
+
* no real labels. In MAQL text the type is spelled `computed_attribute`, which
|
|
59
|
+
* {@link normalizeMaqlObjectType} translates into the `computedAttribute` Tiger type used here.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export interface ITigerComputedAttribute extends IComputedAttributeMetadataObject, ITigerMetadataObject {
|
|
64
|
+
type: "computedAttribute";
|
|
65
|
+
tigerType: "computedAttribute";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export interface ITigerParameter extends IParameterMetadataObject, ITigerMetadataObject {
|
|
71
|
+
type: "parameter";
|
|
72
|
+
tigerType: "parameter";
|
|
73
|
+
}
|
|
74
|
+
export declare function isITigerAttribute(object: ITigerMetadataObject): object is ITigerAttribute;
|
|
75
|
+
export declare function isITigerLabel(object: ITigerMetadataObject): object is ITigerLabel;
|
|
76
|
+
export declare function isITigerDateLabel(object: ITigerMetadataObject): object is ITigerDateLabel;
|
|
77
|
+
export declare function isITigerFact(object: ITigerMetadataObject): object is ITigerFact;
|
|
78
|
+
export declare function isITigerMetric(object: ITigerMetadataObject): object is ITigerMetric;
|
|
79
|
+
export declare function isITigerComputedAttribute(object: ITigerMetadataObject): object is ITigerComputedAttribute;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export declare function isITigerParameter(object: ITigerMetadataObject): object is ITigerParameter;
|
|
84
|
+
/**
|
|
85
|
+
* The dataset fields that MAQL completion uses. SPI dataset metadata objects and declarative
|
|
86
|
+
* datasets both have them.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export interface ILdmDataset {
|
|
91
|
+
id: string;
|
|
92
|
+
title: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
export declare class LdmObjects {
|
|
99
|
+
private readonly attributes;
|
|
100
|
+
private readonly labels;
|
|
101
|
+
private readonly facts;
|
|
102
|
+
private readonly metrics;
|
|
103
|
+
private readonly computedAttributes;
|
|
104
|
+
private readonly parameters;
|
|
105
|
+
private readonly datasets;
|
|
106
|
+
readonly size: number;
|
|
107
|
+
constructor(attributes: ICatalogAttribute[], facts: ICatalogFact[], metrics: ICatalogMeasure[], parameters: IParameterMetadataObject[], dates: ICatalogDateDataset[], datasets: ILdmDataset[], computedAttributes?: IComputedAttributeMetadataObject[]);
|
|
108
|
+
get(type: "attribute", typeModifier?: TypeModifiers): ITigerAttribute[];
|
|
109
|
+
get(type: "label", typeModifier?: TypeModifiers): ITigerLabel[];
|
|
110
|
+
get(type: "fact", typeModifier?: undefined): ITigerFact[];
|
|
111
|
+
get(type: "dataset", typeModifier?: undefined): ITigerDataset[];
|
|
112
|
+
get(type: "metric", typeModifier?: undefined): ITigerMetric[];
|
|
113
|
+
get(type: "computedAttribute", typeModifier?: undefined): ITigerComputedAttribute[];
|
|
114
|
+
get(type: "parameter", typeModifier?: undefined): ITigerParameter[];
|
|
115
|
+
get(type: TigerObjectType, typeModifier?: TypeModifiers): ITigerMetadataObject[] | undefined;
|
|
116
|
+
findObject(object: ITigerMetadataObjectStub): ITigerMetadataObject | undefined;
|
|
117
|
+
findById(type: "metric", id: string): ITigerMetric | undefined;
|
|
118
|
+
findById(type: "parameter", id: string): ITigerParameter | undefined;
|
|
119
|
+
findById(type: TigerObjectType, id: string): ITigerMetadataObject | undefined;
|
|
120
|
+
private processAttributes;
|
|
121
|
+
private processDates;
|
|
122
|
+
private static toTigerMetadataObject;
|
|
123
|
+
private static toTigerDataset;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
export interface IMetadataObjectStruct<T extends IMetadataObject> {
|
|
129
|
+
regular: T[];
|
|
130
|
+
date: T[];
|
|
131
|
+
all: T[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
export type TypeModifiers = keyof IMetadataObjectStruct<IMetadataObject>;
|
|
137
|
+
/**
|
|
138
|
+
* @param labels - label objects for which to get elements
|
|
139
|
+
* @param excluded - label elements which should be filtered out from the result
|
|
140
|
+
* @param options - label elements API advanced query options
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
export type LabelElementsFunc = <T extends ITigerMetadataObjectStub>(labels: T[], excluded: string[], options: IElementsQueryOptions, limit?: number, offset?: number) => Promise<ILabelElementsFuncResult<T>>;
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
*/
|
|
147
|
+
export interface ILabelElementsFuncResult<T extends ITigerMetadataObjectStub> {
|
|
148
|
+
list: ILabelElementList;
|
|
149
|
+
rejected: T[];
|
|
150
|
+
/**
|
|
151
|
+
* Errors the elements queries of the rejected labels failed with
|
|
152
|
+
*/
|
|
153
|
+
rejectionReasons?: Map<T, unknown>;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
export interface ILabelElementList {
|
|
159
|
+
elements: IAttributeElement[];
|
|
160
|
+
isIncomplete: boolean;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/metadata/model.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,143 @@
|
|
|
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
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export function isITigerParameter(object) {
|
|
26
|
+
return object.tigerType === "parameter";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export class LdmObjects {
|
|
32
|
+
attributes;
|
|
33
|
+
labels;
|
|
34
|
+
facts;
|
|
35
|
+
metrics;
|
|
36
|
+
computedAttributes;
|
|
37
|
+
parameters;
|
|
38
|
+
datasets;
|
|
39
|
+
size;
|
|
40
|
+
constructor(attributes, facts, metrics, parameters, dates, datasets, computedAttributes = []) {
|
|
41
|
+
const processedAttributes = this.processAttributes(attributes);
|
|
42
|
+
const processedDates = this.processDates(dates);
|
|
43
|
+
const regularAttributes = processedAttributes.flatMap((item) => item.attributes);
|
|
44
|
+
const dateAttributes = processedDates.flatMap((item) => item.attributes);
|
|
45
|
+
this.attributes = {
|
|
46
|
+
regular: regularAttributes,
|
|
47
|
+
date: dateAttributes,
|
|
48
|
+
all: regularAttributes.concat(dateAttributes),
|
|
49
|
+
};
|
|
50
|
+
const regularLabels = processedAttributes.flatMap((item) => item.labels);
|
|
51
|
+
const dateLabels = processedDates.flatMap((item) => item.labels);
|
|
52
|
+
this.labels = {
|
|
53
|
+
regular: regularLabels,
|
|
54
|
+
date: dateLabels,
|
|
55
|
+
all: regularLabels.concat(dateLabels),
|
|
56
|
+
};
|
|
57
|
+
this.facts = facts.map((fact) => LdmObjects.toTigerMetadataObject(fact.fact));
|
|
58
|
+
this.metrics = metrics.map((metric) => LdmObjects.toTigerMetadataObject(metric.measure));
|
|
59
|
+
this.computedAttributes = computedAttributes.map((computedAttribute) => LdmObjects.toTigerMetadataObject(computedAttribute));
|
|
60
|
+
this.parameters = parameters.map((parameter) => LdmObjects.toTigerMetadataObject(parameter));
|
|
61
|
+
this.datasets = datasets.map((dataset) => LdmObjects.toTigerDataset(dataset));
|
|
62
|
+
this.size =
|
|
63
|
+
this.attributes.all.length +
|
|
64
|
+
this.labels.all.length +
|
|
65
|
+
this.facts.length +
|
|
66
|
+
this.metrics.length +
|
|
67
|
+
this.computedAttributes.length +
|
|
68
|
+
this.parameters.length;
|
|
69
|
+
}
|
|
70
|
+
get(type, typeModifier = "all") {
|
|
71
|
+
switch (type) {
|
|
72
|
+
case "attribute":
|
|
73
|
+
return this.attributes[typeModifier];
|
|
74
|
+
case "fact":
|
|
75
|
+
return this.facts;
|
|
76
|
+
case "metric":
|
|
77
|
+
return this.metrics;
|
|
78
|
+
case "computedAttribute":
|
|
79
|
+
return this.computedAttributes;
|
|
80
|
+
case "parameter":
|
|
81
|
+
return this.parameters;
|
|
82
|
+
case "dataset":
|
|
83
|
+
return this.datasets;
|
|
84
|
+
case "label":
|
|
85
|
+
return this.labels[typeModifier];
|
|
86
|
+
default:
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
findObject(object) {
|
|
91
|
+
if (!object.tigerType) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
const objects = this.get(object.tigerType);
|
|
95
|
+
return objects?.find((tigerObject) => areObjRefsEqual(tigerObject.ref, object.ref));
|
|
96
|
+
}
|
|
97
|
+
findById(type, id) {
|
|
98
|
+
return this.get(type)?.find((object) => object.id === id);
|
|
99
|
+
}
|
|
100
|
+
processAttributes(attributes) {
|
|
101
|
+
return attributes.flatMap((attribute) => ({
|
|
102
|
+
attributes: [LdmObjects.toTigerMetadataObject(attribute.attribute)],
|
|
103
|
+
labels: attribute.displayForms.flatMap((label) => LdmObjects.toTigerMetadataObject(label)),
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
processDates(dates) {
|
|
107
|
+
return dates.flatMap((date) => ({
|
|
108
|
+
attributes: dates.flatMap((date) => date.dateAttributes.map((attr) => ({
|
|
109
|
+
tigerTypeModifier: "date",
|
|
110
|
+
granularity: attr.granularity,
|
|
111
|
+
...LdmObjects.toTigerMetadataObject(attr.attribute),
|
|
112
|
+
}))),
|
|
113
|
+
labels: date.dateAttributes.flatMap((dateAttr) => dateAttr.attribute.displayForms.map((label) => ({
|
|
114
|
+
tigerTypeModifier: "date",
|
|
115
|
+
granularity: dateAttr.granularity,
|
|
116
|
+
...LdmObjects.toTigerMetadataObject(label),
|
|
117
|
+
}))),
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
static toTigerMetadataObject(metadataObject) {
|
|
121
|
+
return {
|
|
122
|
+
tigerType: objectTypeToTigerIdType[metadataObject.type],
|
|
123
|
+
...metadataObject,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static toTigerDataset(dataset) {
|
|
127
|
+
return {
|
|
128
|
+
type: "dataSet",
|
|
129
|
+
tigerType: "dataset",
|
|
130
|
+
id: dataset.id,
|
|
131
|
+
title: dataset.title,
|
|
132
|
+
description: dataset.description || "",
|
|
133
|
+
deprecated: false,
|
|
134
|
+
production: true,
|
|
135
|
+
ref: {
|
|
136
|
+
type: "dataSet",
|
|
137
|
+
identifier: dataset.id,
|
|
138
|
+
},
|
|
139
|
+
unlisted: false,
|
|
140
|
+
uri: "",
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -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;AAE7F,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,37 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { escapeString } from "@gooddata/maql-antlr4ts";
|
|
3
|
+
import { isStringParameterDefinition } from "@gooddata/sdk-model";
|
|
4
|
+
export function parameterTypeLabel(definition) {
|
|
5
|
+
return definition.type.toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
export function parameterDefaultLabel(definition) {
|
|
8
|
+
return JSON.stringify(definition.defaultValue);
|
|
9
|
+
}
|
|
10
|
+
export function parameterSummary(definition) {
|
|
11
|
+
return `${parameterTypeLabel(definition)}, default: ${parameterDefaultLabel(definition)}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether a definition describes a default that can be written into MAQL. A parameter file being
|
|
15
|
+
* edited reaches us with a type it has not finished, or a default of the wrong kind for the type it
|
|
16
|
+
* declares, neither of which the declared type admits.
|
|
17
|
+
*/
|
|
18
|
+
export function isRenderableDefinition(definition) {
|
|
19
|
+
const candidate = definition;
|
|
20
|
+
switch (candidate?.type) {
|
|
21
|
+
case "STRING":
|
|
22
|
+
return typeof candidate.defaultValue === "string";
|
|
23
|
+
case "NUMBER":
|
|
24
|
+
return typeof candidate.defaultValue === "number";
|
|
25
|
+
default:
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The parameter's default as it would be written in MAQL: string defaults quoted and escaped,
|
|
31
|
+
* numeric ones bare.
|
|
32
|
+
*/
|
|
33
|
+
export function parameterMaqlLiteral(definition) {
|
|
34
|
+
return isStringParameterDefinition(definition)
|
|
35
|
+
? escapeString(definition.defaultValue, '"')
|
|
36
|
+
: String(definition.defaultValue);
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export interface IMetadataInterface {
|
|
12
|
+
updateModel(): void;
|
|
13
|
+
getLdmObjects(items?: IAttributeOrMeasure[]): Promise<LdmObjects>;
|
|
14
|
+
getLabelElementsFunction(): Promise<LabelElementsFunc>;
|
|
15
|
+
}
|
|
16
|
+
//# 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;;;;;;;GAOG;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,56 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface IMetadataServiceOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Resolved value of the enableComputedAttributes workspace setting. The computed-attributes
|
|
11
|
+
* catalog listing is gated by it on the backend, so when the host knows the setting is off the
|
|
12
|
+
* service does not request the type at all. Leave undefined when the setting is unknown: the
|
|
13
|
+
* service then requests computed attributes and degrades to the default type set on refusal.
|
|
14
|
+
*/
|
|
15
|
+
enableComputedAttributes?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare class MetadataService implements IMetadataInterface {
|
|
21
|
+
readonly workspaceId: string;
|
|
22
|
+
readonly backend: IAnalyticalBackend;
|
|
23
|
+
private readonly options;
|
|
24
|
+
private catalog?;
|
|
25
|
+
private ldmObjects;
|
|
26
|
+
private datasets;
|
|
27
|
+
private parameters;
|
|
28
|
+
/**
|
|
29
|
+
* The only construction path: the service runs on the backend injected by the host — the same
|
|
30
|
+
* instance (auth provider, caches and all) every other consumer of the host uses.
|
|
31
|
+
*/
|
|
32
|
+
static withBackend(workspaceId: string, backend: IAnalyticalBackend, options?: IMetadataServiceOptions): MetadataService;
|
|
33
|
+
private constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Gets all objects (facts, metrics, attributes and labels) from the
|
|
36
|
+
* declarative model retrieved from Metadata API.
|
|
37
|
+
*/
|
|
38
|
+
getLdmObjects(items?: IAttributeOrMeasure[]): Promise<LdmObjects>;
|
|
39
|
+
/**
|
|
40
|
+
* Makes a new request to Metadata API for an updated declarative model.
|
|
41
|
+
* Refreshes stored objects from the received model.
|
|
42
|
+
*/
|
|
43
|
+
updateModel(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Makes a request to Catalog API to slice datasets for
|
|
46
|
+
* available items; doesn't update model with fresh data!
|
|
47
|
+
* Only updates ldmObjects.
|
|
48
|
+
*/
|
|
49
|
+
sliceModel(items: IAttributeOrMeasure[]): Promise<LdmObjects>;
|
|
50
|
+
private getWholeCatalog;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a function to later retrieve label elements
|
|
53
|
+
*/
|
|
54
|
+
getLabelElementsFunction(): Promise<LabelElementsFunc>;
|
|
55
|
+
}
|
|
56
|
+
//# 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;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;GAEG;AACH,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,159 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { DefaultWorkspaceCatalogTypes, } from "@gooddata/sdk-backend-spi";
|
|
3
|
+
import { LdmObjects, } from "./metadata/model.js";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export class MetadataService {
|
|
8
|
+
workspaceId;
|
|
9
|
+
backend;
|
|
10
|
+
options;
|
|
11
|
+
catalog; // holds the entire unprocessed catalog
|
|
12
|
+
ldmObjects; // LDM objects holds latest parsed objects to be used further
|
|
13
|
+
datasets = [];
|
|
14
|
+
parameters = [];
|
|
15
|
+
/**
|
|
16
|
+
* The only construction path: the service runs on the backend injected by the host — the same
|
|
17
|
+
* instance (auth provider, caches and all) every other consumer of the host uses.
|
|
18
|
+
*/
|
|
19
|
+
static withBackend(workspaceId, backend, options = {}) {
|
|
20
|
+
return new MetadataService(workspaceId, backend, options);
|
|
21
|
+
}
|
|
22
|
+
constructor(workspaceId, backend, options) {
|
|
23
|
+
this.workspaceId = workspaceId;
|
|
24
|
+
this.backend = backend;
|
|
25
|
+
this.options = options;
|
|
26
|
+
this.catalog = undefined;
|
|
27
|
+
this.ldmObjects = this.getWholeCatalog();
|
|
28
|
+
this.sliceModel = this.sliceModel.bind(this);
|
|
29
|
+
this.getLdmObjects = this.getLdmObjects.bind(this);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets all objects (facts, metrics, attributes and labels) from the
|
|
33
|
+
* declarative model retrieved from Metadata API.
|
|
34
|
+
*/
|
|
35
|
+
async getLdmObjects(items) {
|
|
36
|
+
return items && items.length > 0 ? this.sliceModel(items) : this.ldmObjects;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Makes a new request to Metadata API for an updated declarative model.
|
|
40
|
+
* Refreshes stored objects from the received model.
|
|
41
|
+
*/
|
|
42
|
+
updateModel() {
|
|
43
|
+
this.ldmObjects = this.getWholeCatalog();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Makes a request to Catalog API to slice datasets for
|
|
47
|
+
* available items; doesn't update model with fresh data!
|
|
48
|
+
* Only updates ldmObjects.
|
|
49
|
+
*/
|
|
50
|
+
sliceModel(items) {
|
|
51
|
+
if (!this.catalog || items.length === 0) {
|
|
52
|
+
return this.ldmObjects;
|
|
53
|
+
}
|
|
54
|
+
return this.catalog
|
|
55
|
+
.availableItems()
|
|
56
|
+
.forItems(items)
|
|
57
|
+
.load()
|
|
58
|
+
.then((catalog) => {
|
|
59
|
+
return new LdmObjects(catalog.availableAttributes(), catalog.availableFacts(), catalog.availableMeasures(), this.parameters, catalog.availableDateDatasets(), this.datasets, catalog.availableComputedAttributes().map((item) => item.computedAttribute));
|
|
60
|
+
// TODO: Handling errors (when nothing is found, etc.)
|
|
61
|
+
})
|
|
62
|
+
.catch(() => this.ldmObjects);
|
|
63
|
+
}
|
|
64
|
+
async getWholeCatalog() {
|
|
65
|
+
// Origin ALL includes the datasets inherited from parent workspaces. Completion lists the
|
|
66
|
+
// NORMAL and AUXILIARY datasets; date datasets come from the catalog. A backend without the
|
|
67
|
+
// service throws synchronously, and a failed listing removes only the dataset completion.
|
|
68
|
+
const listDatasets = (dataSetType) => this.backend
|
|
69
|
+
.workspace(this.workspaceId)
|
|
70
|
+
.datasets()
|
|
71
|
+
.getDatasetsQuery()
|
|
72
|
+
.withOrigin("ALL")
|
|
73
|
+
.withFilter({ dataSetType })
|
|
74
|
+
.withSize(1000)
|
|
75
|
+
.query()
|
|
76
|
+
.then((result) => result.all());
|
|
77
|
+
const datasetsPromise = Promise.resolve()
|
|
78
|
+
.then(() => Promise.all([listDatasets("NORMAL"), listDatasets("AUXILIARY")]))
|
|
79
|
+
.then((lists) => lists.flat())
|
|
80
|
+
.catch(() => []);
|
|
81
|
+
const parametersPromise = this.backend
|
|
82
|
+
.workspace(this.workspaceId)
|
|
83
|
+
.parameters()
|
|
84
|
+
.getParametersQuery()
|
|
85
|
+
.withSize(2000)
|
|
86
|
+
.query()
|
|
87
|
+
.then((result) => result.all())
|
|
88
|
+
.catch(() => []);
|
|
89
|
+
// Computed attributes are opt-in on the catalog, so the default type set must be requested
|
|
90
|
+
// alongside them; the requested types also drive what availableItems() (used by
|
|
91
|
+
// sliceModel) asks the backend to validate. The listing is gated by the
|
|
92
|
+
// enableComputedAttributes setting: when the host resolved it as off, skip the request
|
|
93
|
+
// entirely (the backend would refuse it with a 400 logged to the console). Otherwise a
|
|
94
|
+
// backend can still reject it (setting race, older backend), and a single rejected loader
|
|
95
|
+
// fails the whole catalog load - fall back to the default type set rather than losing
|
|
96
|
+
// completion and validation entirely.
|
|
97
|
+
const catalogFactory = this.backend.workspace(this.workspaceId).catalog();
|
|
98
|
+
const catalogPromise = this.options.enableComputedAttributes === false
|
|
99
|
+
? catalogFactory.load()
|
|
100
|
+
: catalogFactory
|
|
101
|
+
.forTypes([...DefaultWorkspaceCatalogTypes, "computedAttribute"])
|
|
102
|
+
.load()
|
|
103
|
+
.catch(() => catalogFactory.load());
|
|
104
|
+
const [datasets, catalog, parameters] = await Promise.all([
|
|
105
|
+
datasetsPromise,
|
|
106
|
+
catalogPromise,
|
|
107
|
+
parametersPromise,
|
|
108
|
+
]);
|
|
109
|
+
this.datasets = datasets;
|
|
110
|
+
this.catalog = catalog;
|
|
111
|
+
this.parameters = parameters;
|
|
112
|
+
return new LdmObjects(catalog.attributes(), catalog.facts(), catalog.measures(), parameters, catalog.dateDatasets(), this.datasets, catalog.computedAttributes().map((item) => item.computedAttribute));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Returns a function to later retrieve label elements
|
|
116
|
+
*/
|
|
117
|
+
getLabelElementsFunction() {
|
|
118
|
+
const queryFactory = this.backend.workspace(this.workspaceId).attributes().elements();
|
|
119
|
+
return Promise.resolve(async (labels, excluded, options, limit, offset) => {
|
|
120
|
+
const settled = await Promise.allSettled(labels.map((label) => {
|
|
121
|
+
let query = queryFactory.forDisplayForm(label.ref).withOptions(options);
|
|
122
|
+
if (limit)
|
|
123
|
+
query = query.withLimit(limit);
|
|
124
|
+
if (offset)
|
|
125
|
+
query = query.withOffset(offset);
|
|
126
|
+
return query.query();
|
|
127
|
+
}));
|
|
128
|
+
const rejected = [];
|
|
129
|
+
const rejectionReasons = new Map();
|
|
130
|
+
const results = settled
|
|
131
|
+
.map((result, idx) => {
|
|
132
|
+
if (result.status === "fulfilled") {
|
|
133
|
+
return result.value;
|
|
134
|
+
}
|
|
135
|
+
else if (result.status === "rejected") {
|
|
136
|
+
rejected.push(labels[idx]);
|
|
137
|
+
rejectionReasons.set(labels[idx], result.reason);
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
})
|
|
141
|
+
.filter((elements) => !!elements);
|
|
142
|
+
const elements = results
|
|
143
|
+
.map((result) => result.items)
|
|
144
|
+
.flat()
|
|
145
|
+
.filter((element) => element.title === null || !excluded.includes(element.title)); // Filter out already typed strings
|
|
146
|
+
const isIncomplete = results
|
|
147
|
+
.map((result) => result.offset + result.limit < result.totalCount)
|
|
148
|
+
.reduce((prev, curr) => prev || curr, false);
|
|
149
|
+
return {
|
|
150
|
+
list: {
|
|
151
|
+
elements: elements,
|
|
152
|
+
isIncomplete: isIncomplete,
|
|
153
|
+
},
|
|
154
|
+
rejected: rejected,
|
|
155
|
+
rejectionReasons: rejectionReasons,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -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"}
|