@gooddata/code-cli 0.43.0-alpha.0 → 0.43.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +109 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37366,7 +37366,7 @@ function isPromise(value) {
|
|
|
37366
37366
|
//#endregion
|
|
37367
37367
|
//#region package.json
|
|
37368
37368
|
var name$1 = "@gooddata/code-cli";
|
|
37369
|
-
var version$1 = "0.43.0-alpha.
|
|
37369
|
+
var version$1 = "0.43.0-alpha.2";
|
|
37370
37370
|
//#endregion
|
|
37371
37371
|
//#region ../code/esm/features/references/types.js
|
|
37372
37372
|
var UpdateReferencesType;
|
|
@@ -40633,6 +40633,10 @@ const metadata_v1 = {
|
|
|
40633
40633
|
}
|
|
40634
40634
|
}
|
|
40635
40635
|
},
|
|
40636
|
+
"line_style_mapping": {
|
|
40637
|
+
"$ref": "#/$defs/lineStyleMapping",
|
|
40638
|
+
"description": "Per-series line style and weight overrides. Keys are measure identifiers."
|
|
40639
|
+
},
|
|
40636
40640
|
"conditional_formatting": {
|
|
40637
40641
|
"type": "object",
|
|
40638
40642
|
"description": "Conditional formatting rules that color cells or rows based on their values.",
|
|
@@ -42745,6 +42749,41 @@ const metadata_v1 = {
|
|
|
42745
42749
|
"snippets": ["color"]
|
|
42746
42750
|
}]
|
|
42747
42751
|
},
|
|
42752
|
+
"lineStyleMapping": {
|
|
42753
|
+
"title": "Line Style Mapping",
|
|
42754
|
+
"type": "object",
|
|
42755
|
+
"$semantic": {
|
|
42756
|
+
"type": "reference",
|
|
42757
|
+
"source": "current.query.metric.localId",
|
|
42758
|
+
"mode": "property"
|
|
42759
|
+
},
|
|
42760
|
+
"additionalProperties": {
|
|
42761
|
+
"type": "object",
|
|
42762
|
+
"additionalProperties": false,
|
|
42763
|
+
"minProperties": 1,
|
|
42764
|
+
"properties": {
|
|
42765
|
+
"style": {
|
|
42766
|
+
"type": "string",
|
|
42767
|
+
"enum": [
|
|
42768
|
+
"solid",
|
|
42769
|
+
"dashed",
|
|
42770
|
+
"dotted"
|
|
42771
|
+
],
|
|
42772
|
+
"description": "Line stroke style for this series."
|
|
42773
|
+
},
|
|
42774
|
+
"width": {
|
|
42775
|
+
"type": "integer",
|
|
42776
|
+
"enum": [
|
|
42777
|
+
1,
|
|
42778
|
+
2,
|
|
42779
|
+
3,
|
|
42780
|
+
4
|
|
42781
|
+
],
|
|
42782
|
+
"description": "Line stroke width in pixels for this series."
|
|
42783
|
+
}
|
|
42784
|
+
}
|
|
42785
|
+
}
|
|
42786
|
+
},
|
|
42748
42787
|
"complexColorItem": {
|
|
42749
42788
|
"title": "Color",
|
|
42750
42789
|
"oneOf": [{ "type": "number" }, {
|
|
@@ -90757,6 +90796,42 @@ function getIdByDef(def) {
|
|
|
90757
90796
|
}
|
|
90758
90797
|
}
|
|
90759
90798
|
/** @public */
|
|
90799
|
+
function loadLineStyleMapping(mappings) {
|
|
90800
|
+
if (!mappings || mappings.length === 0) return;
|
|
90801
|
+
const deduped = /* @__PURE__ */ new Map();
|
|
90802
|
+
for (const { id, lineStyle, lineWidth } of mappings) {
|
|
90803
|
+
const entry = {};
|
|
90804
|
+
if (lineStyle !== void 0) entry["style"] = lineStyle;
|
|
90805
|
+
if (lineWidth !== void 0) entry["width"] = lineWidth;
|
|
90806
|
+
if (Object.keys(entry).length > 0) deduped.set(id, entry);
|
|
90807
|
+
}
|
|
90808
|
+
if (deduped.size === 0) return;
|
|
90809
|
+
const map = new import_dist$1.YAMLMap();
|
|
90810
|
+
for (const [id, entry] of deduped) map.add(new import_dist$1.Pair(id, entry));
|
|
90811
|
+
return map;
|
|
90812
|
+
}
|
|
90813
|
+
const VALID_LINE_STYLES = [
|
|
90814
|
+
"solid",
|
|
90815
|
+
"dashed",
|
|
90816
|
+
"dotted"
|
|
90817
|
+
];
|
|
90818
|
+
const VALID_LINE_WIDTHS = [
|
|
90819
|
+
1,
|
|
90820
|
+
2,
|
|
90821
|
+
3,
|
|
90822
|
+
4
|
|
90823
|
+
];
|
|
90824
|
+
/** @public */
|
|
90825
|
+
function saveLineStyleMapping(mapping) {
|
|
90826
|
+
if (!mapping) return;
|
|
90827
|
+
const entries = Object.entries(mapping).map(([id, val]) => ({
|
|
90828
|
+
id,
|
|
90829
|
+
lineStyle: VALID_LINE_STYLES.includes(val.style) ? val.style : void 0,
|
|
90830
|
+
lineWidth: VALID_LINE_WIDTHS.includes(val.width) ? val.width : void 0
|
|
90831
|
+
})).filter((e) => e.lineStyle !== void 0 || e.lineWidth !== void 0);
|
|
90832
|
+
return entries.length > 0 ? entries : void 0;
|
|
90833
|
+
}
|
|
90834
|
+
/** @public */
|
|
90760
90835
|
function loadColumnsWidth(widths) {
|
|
90761
90836
|
if (widths.length === 0) return;
|
|
90762
90837
|
return widths.map((width) => {
|
|
@@ -91731,7 +91806,8 @@ const DEFAULTS$16 = {
|
|
|
91731
91806
|
disableKeyDriveAnalysisOn: {},
|
|
91732
91807
|
customTooltip: DEFAULT_CUSTOM_TOOLTIP,
|
|
91733
91808
|
thresholdMeasures: [],
|
|
91734
|
-
thresholdExcludedMeasures: []
|
|
91809
|
+
thresholdExcludedMeasures: [],
|
|
91810
|
+
lineStyleMapping: []
|
|
91735
91811
|
};
|
|
91736
91812
|
/** @internal */
|
|
91737
91813
|
function comboChartLoad(props) {
|
|
@@ -91806,6 +91882,7 @@ function comboChartLoad(props) {
|
|
|
91806
91882
|
case "customTooltip": return [["custom_tooltip", loadCustomTooltip(value)]];
|
|
91807
91883
|
case "thresholdMeasures": return [["line_style_control_metrics", getValueOrDefault(value, DEFAULTS$16.thresholdMeasures, "array")]];
|
|
91808
91884
|
case "thresholdExcludedMeasures": return [["line_style_excluded_metrics", getValueOrDefault(value, DEFAULTS$16.thresholdExcludedMeasures, "array")]];
|
|
91885
|
+
case "lineStyleMapping": return [["line_style_mapping", loadLineStyleMapping(value)]];
|
|
91809
91886
|
default: return [];
|
|
91810
91887
|
}
|
|
91811
91888
|
});
|
|
@@ -91881,7 +91958,8 @@ function comboChartSave(_fields, config, buckets = []) {
|
|
|
91881
91958
|
disableKeyDriveAnalysisOn: saveConfigObject(config.disable_key_drive_analysis),
|
|
91882
91959
|
customTooltip: saveConfigObject(saveCustomTooltip(config.custom_tooltip)),
|
|
91883
91960
|
thresholdMeasures: getValueOrDefault(config.line_style_control_metrics, DEFAULTS$16.thresholdMeasures, "array"),
|
|
91884
|
-
thresholdExcludedMeasures: getValueOrDefault(config.line_style_excluded_metrics, DEFAULTS$16.thresholdExcludedMeasures, "array")
|
|
91961
|
+
thresholdExcludedMeasures: getValueOrDefault(config.line_style_excluded_metrics, DEFAULTS$16.thresholdExcludedMeasures, "array"),
|
|
91962
|
+
lineStyleMapping: saveLineStyleMapping(config["line_style_mapping"])
|
|
91885
91963
|
});
|
|
91886
91964
|
}
|
|
91887
91965
|
/**
|
|
@@ -92761,7 +92839,8 @@ const DEFAULTS$8 = {
|
|
|
92761
92839
|
disableKeyDriveAnalysisOn: {},
|
|
92762
92840
|
customTooltip: DEFAULT_CUSTOM_TOOLTIP,
|
|
92763
92841
|
thresholdMeasures: [],
|
|
92764
|
-
thresholdExcludedMeasures: []
|
|
92842
|
+
thresholdExcludedMeasures: [],
|
|
92843
|
+
lineStyleMapping: []
|
|
92765
92844
|
};
|
|
92766
92845
|
/** @internal */
|
|
92767
92846
|
function lineChartLoad(props) {
|
|
@@ -92835,6 +92914,7 @@ function lineChartLoad(props) {
|
|
|
92835
92914
|
case "customTooltip": return [["custom_tooltip", loadCustomTooltip(value)]];
|
|
92836
92915
|
case "thresholdMeasures": return [["line_style_control_metrics", getValueOrDefault(value, DEFAULTS$8.thresholdMeasures, "array")]];
|
|
92837
92916
|
case "thresholdExcludedMeasures": return [["line_style_excluded_metrics", getValueOrDefault(value, DEFAULTS$8.thresholdExcludedMeasures, "array")]];
|
|
92917
|
+
case "lineStyleMapping": return [["line_style_mapping", loadLineStyleMapping(value)]];
|
|
92838
92918
|
default: return [];
|
|
92839
92919
|
}
|
|
92840
92920
|
});
|
|
@@ -92899,7 +92979,8 @@ function lineChartSave(_fields, config) {
|
|
|
92899
92979
|
disableKeyDriveAnalysisOn: saveConfigObject(config.disable_key_drive_analysis),
|
|
92900
92980
|
customTooltip: saveConfigObject(saveCustomTooltip(config.custom_tooltip)),
|
|
92901
92981
|
thresholdMeasures: getValueOrDefault(config.line_style_control_metrics, DEFAULTS$8.thresholdMeasures, "array"),
|
|
92902
|
-
thresholdExcludedMeasures: getValueOrDefault(config.line_style_excluded_metrics, DEFAULTS$8.thresholdExcludedMeasures, "array")
|
|
92982
|
+
thresholdExcludedMeasures: getValueOrDefault(config.line_style_excluded_metrics, DEFAULTS$8.thresholdExcludedMeasures, "array"),
|
|
92983
|
+
lineStyleMapping: saveLineStyleMapping(config["line_style_mapping"])
|
|
92903
92984
|
});
|
|
92904
92985
|
}
|
|
92905
92986
|
/**
|
|
@@ -145474,6 +145555,17 @@ var LabelElementsFinder = class extends LabelContextMarker {
|
|
|
145474
145555
|
}
|
|
145475
145556
|
};
|
|
145476
145557
|
//#endregion
|
|
145558
|
+
//#region ../../../common/temp/aac/node_modules/.pnpm/gdc-maql-language-server@file+..+..+..+libs+gdc-maql-language-server/node_modules/gdc-maql-language-server/esm/metadata/parameters.js
|
|
145559
|
+
function parameterTypeLabel(definition) {
|
|
145560
|
+
return definition.type.toLowerCase();
|
|
145561
|
+
}
|
|
145562
|
+
function parameterDefaultLabel(definition) {
|
|
145563
|
+
return JSON.stringify(definition.defaultValue);
|
|
145564
|
+
}
|
|
145565
|
+
function parameterSummary(definition) {
|
|
145566
|
+
return `${parameterTypeLabel(definition)}, default: ${parameterDefaultLabel(definition)}`;
|
|
145567
|
+
}
|
|
145568
|
+
//#endregion
|
|
145477
145569
|
//#region ../../../common/temp/aac/node_modules/.pnpm/gdc-maql-language-server@file+..+..+..+libs+gdc-maql-language-server/node_modules/gdc-maql-language-server/esm/parseMaql.js
|
|
145478
145570
|
var import_antlr4ts = require_antlr4ts();
|
|
145479
145571
|
const { CaseInsensitiveCharStream, MaqlAstVisitor, MaqlLexer: MaqlLexer$3, MaqlParser: MaqlParser$5 } = import_dist.default;
|
|
@@ -146990,7 +147082,7 @@ function completeNumeric(ldmObjects, range, allowedTypes) {
|
|
|
146990
147082
|
return items;
|
|
146991
147083
|
}
|
|
146992
147084
|
function completeParameter(ldmObjects, range, allowedTypes) {
|
|
146993
|
-
return ldmObjects.get("parameter").filter((parameter) => allowedTypes.some((type) => isSubtype(parameterMaqlType(parameter.definition), type))).map((obj) =>
|
|
147085
|
+
return ldmObjects.get("parameter").filter((parameter) => allowedTypes.some((type) => isSubtype(parameterMaqlType(parameter.definition), type))).map((obj) => createParameterCompletionItem(obj, range));
|
|
146994
147086
|
}
|
|
146995
147087
|
function parameterMaqlType(definition) {
|
|
146996
147088
|
switch (definition.type) {
|
|
@@ -146998,6 +147090,14 @@ function parameterMaqlType(definition) {
|
|
|
146998
147090
|
case "STRING": return MaqlType.STRING;
|
|
146999
147091
|
}
|
|
147000
147092
|
}
|
|
147093
|
+
function createParameterCompletionItem(parameter, range) {
|
|
147094
|
+
const item = createMetadataCompletionItem(parameter, range);
|
|
147095
|
+
return {
|
|
147096
|
+
...item,
|
|
147097
|
+
labelDetails: { description: parameterTypeLabel(parameter.definition) },
|
|
147098
|
+
detail: `${item.detail}, Default: ${parameterDefaultLabel(parameter.definition)}`
|
|
147099
|
+
};
|
|
147100
|
+
}
|
|
147001
147101
|
const preferredRules = new Set([
|
|
147002
147102
|
MaqlParser.RULE_attribute,
|
|
147003
147103
|
MaqlParser.RULE_numeric,
|
|
@@ -151233,7 +151333,7 @@ function markdownObjectContent(object) {
|
|
|
151233
151333
|
lines.push(`## ${object.title}`);
|
|
151234
151334
|
if (object.description && object.description.length > 0) lines.push(object.description);
|
|
151235
151335
|
if (isITigerMetric(object)) lines.push("```maql", object.expression, "```", `format: ${object.format}`);
|
|
151236
|
-
if (isITigerParameter(object)) lines.push(
|
|
151336
|
+
if (isITigerParameter(object)) lines.push(`Parameter (${parameterSummary(object.definition)})`);
|
|
151237
151337
|
return lines.join("\n");
|
|
151238
151338
|
}
|
|
151239
151339
|
function objectContent(object) {
|
|
@@ -151386,7 +151486,7 @@ const _CONFIG = {
|
|
|
151386
151486
|
common: {
|
|
151387
151487
|
"X-Requested-With": "XMLHttpRequest",
|
|
151388
151488
|
"X-GDC-JS-PACKAGE": "@gooddata/api-client-tiger",
|
|
151389
|
-
"X-GDC-JS-PACKAGE-VERSION": "11.47.0-alpha.
|
|
151489
|
+
"X-GDC-JS-PACKAGE-VERSION": "11.47.0-alpha.2"
|
|
151390
151490
|
},
|
|
151391
151491
|
post: { "Content-Type": "application/json;charset=utf8" },
|
|
151392
151492
|
put: { "Content-Type": "application/json;charset=utf8" }
|
|
@@ -196980,7 +197080,7 @@ async function get(state, opts) {
|
|
|
196980
197080
|
//#endregion
|
|
196981
197081
|
//#region ../code/package.json
|
|
196982
197082
|
var name = "@gooddata/code";
|
|
196983
|
-
var version = "0.43.0-alpha.
|
|
197083
|
+
var version = "0.43.0-alpha.2";
|
|
196984
197084
|
//#endregion
|
|
196985
197085
|
//#region ../code/esm/actions/initialize.js
|
|
196986
197086
|
async function initialize(state, emitter, options) {
|