@gooddata/sdk-code-convertors 11.35.0-alpha.5 → 11.35.0-alpha.6
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/esm/configs/areaChart.d.ts +22 -9
- package/esm/configs/areaChart.js +13 -4
- package/esm/configs/barChart.d.ts +22 -9
- package/esm/configs/barChart.js +13 -4
- package/esm/configs/bubbleChart.d.ts +22 -9
- package/esm/configs/bubbleChart.js +13 -4
- package/esm/configs/bulletChart.d.ts +22 -9
- package/esm/configs/bulletChart.js +13 -4
- package/esm/configs/columnChart.d.ts +22 -9
- package/esm/configs/columnChart.js +13 -4
- package/esm/configs/comboChart.d.ts +22 -9
- package/esm/configs/comboChart.js +13 -4
- package/esm/configs/dependencyWheelChart.d.ts +22 -9
- package/esm/configs/dependencyWheelChart.js +13 -4
- package/esm/configs/donutChart.d.ts +22 -9
- package/esm/configs/donutChart.js +13 -4
- package/esm/configs/funnelChart.d.ts +22 -9
- package/esm/configs/funnelChart.js +13 -4
- package/esm/configs/geoAreaChart.d.ts +22 -9
- package/esm/configs/geoAreaChart.js +13 -4
- package/esm/configs/geoChart.d.ts +22 -9
- package/esm/configs/geoChart.js +13 -4
- package/esm/configs/headlineChart.d.ts +22 -9
- package/esm/configs/headlineChart.js +13 -4
- package/esm/configs/heatmapChart.d.ts +22 -9
- package/esm/configs/heatmapChart.js +13 -4
- package/esm/configs/lineChart.d.ts +22 -9
- package/esm/configs/lineChart.js +13 -4
- package/esm/configs/pieChart.d.ts +22 -9
- package/esm/configs/pieChart.js +13 -4
- package/esm/configs/pyramidChart.d.ts +22 -9
- package/esm/configs/pyramidChart.js +13 -4
- package/esm/configs/repeaterChart.d.ts +25 -10
- package/esm/configs/repeaterChart.js +15 -5
- package/esm/configs/sankeyChart.d.ts +22 -9
- package/esm/configs/sankeyChart.js +13 -4
- package/esm/configs/scatterChart.d.ts +22 -9
- package/esm/configs/scatterChart.js +13 -4
- package/esm/configs/table.d.ts +22 -9
- package/esm/configs/table.js +13 -4
- package/esm/configs/treemapChart.d.ts +22 -9
- package/esm/configs/treemapChart.js +13 -4
- package/esm/configs/types.d.ts +28 -0
- package/esm/configs/utils.d.ts +1 -0
- package/esm/configs/waterfallChart.d.ts +22 -9
- package/esm/configs/waterfallChart.js +13 -4
- package/esm/conts.d.ts +8 -0
- package/esm/conts.js +8 -0
- package/esm/from/declarativeDashboardToYaml.d.ts +9 -0
- package/esm/from/declarativeDashboardToYaml.js +7 -0
- package/esm/from/declarativeVisualisationToYaml.d.ts +47 -17
- package/esm/from/declarativeVisualisationToYaml.js +19 -0
- package/esm/index.d.ts +27 -27
- package/esm/index.js +23 -23
- package/esm/sdk-code-convertors.d.ts +2107 -1647
- package/esm/to/yamlDashboardToDeclarative.d.ts +18 -5
- package/esm/to/yamlDashboardToDeclarative.js +5 -0
- package/esm/to/yamlDatasetToDeclarative.d.ts +4 -0
- package/esm/to/yamlDatasetToDeclarative.js +4 -0
- package/esm/to/yamlVisualisationToDeclarative.d.ts +7 -2
- package/esm/to/yamlVisualisationToDeclarative.js +5 -0
- package/esm/utils/sharedUtils.d.ts +1 -0
- package/package.json +7 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
2
|
import { loadChartFill, loadColorMapping, saveChartFill, saveColorMapping } from "../utils/configUtils.js";
|
|
3
3
|
import { getValueOrDefault, loadConfig, saveConfigObject, } from "./utils.js";
|
|
4
|
+
/** @internal */
|
|
4
5
|
const DEFAULTS = {
|
|
5
6
|
colorMapping: [],
|
|
6
7
|
dataLabels: {
|
|
@@ -18,7 +19,10 @@ const DEFAULTS = {
|
|
|
18
19
|
disableAlerts: false,
|
|
19
20
|
disableScheduledExports: false,
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const TREEMAP_CHART_DEFAULTS = DEFAULTS;
|
|
24
|
+
/** @internal */
|
|
25
|
+
export function treemapChartLoad(props) {
|
|
22
26
|
return loadConfig(props, (key, value) => {
|
|
23
27
|
switch (key) {
|
|
24
28
|
case "colorMapping":
|
|
@@ -68,7 +72,8 @@ function load(props) {
|
|
|
68
72
|
}
|
|
69
73
|
});
|
|
70
74
|
}
|
|
71
|
-
|
|
75
|
+
/** @internal */
|
|
76
|
+
export function treemapChartSave(_fields, config) {
|
|
72
77
|
if (!config) {
|
|
73
78
|
return undefined;
|
|
74
79
|
}
|
|
@@ -88,8 +93,12 @@ function save(_fields, config) {
|
|
|
88
93
|
disableScheduledExports: getValueOrDefault(config.disable_scheduled_exports, DEFAULTS.disableScheduledExports, "bool"),
|
|
89
94
|
});
|
|
90
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
* @deprecated Use treemapChartLoad and treemapChartSave instead.
|
|
99
|
+
*/
|
|
91
100
|
export const treemapChart = {
|
|
92
|
-
load,
|
|
93
|
-
save,
|
|
101
|
+
load: treemapChartLoad,
|
|
102
|
+
save: treemapChartSave,
|
|
94
103
|
DEFAULTS,
|
|
95
104
|
};
|
package/esm/configs/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @public */
|
|
1
2
|
export type ColorMapping = {
|
|
2
3
|
id: string;
|
|
3
4
|
color: {
|
|
@@ -12,81 +13,108 @@ export type ColorMapping = {
|
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
};
|
|
16
|
+
/** @internal */
|
|
15
17
|
export type PointShapeSymbol = "circle" | "square" | "diamond" | "triangle" | "triangle-down";
|
|
18
|
+
/** @internal */
|
|
16
19
|
export interface IChartFill {
|
|
17
20
|
type: ChartFillType;
|
|
18
21
|
measureToPatternName?: Record<string, PatternFillName>;
|
|
19
22
|
}
|
|
23
|
+
/** @internal */
|
|
20
24
|
export type ChartFillType = "solid" | "pattern" | "outline";
|
|
25
|
+
/** @internal */
|
|
21
26
|
export type PatternFillName = "diagonal_grid_small" | "vertical_lines_small" | "grid_small" | "horizontal_lines_small" | "circle_small" | "flag_small" | "waffle_small" | "dot_small" | "pyramid_small" | "needle_small" | "diamond_small" | "pizza_small" | "diagonal_grid_medium" | "vertical_lines_medium" | "grid_large" | "horizontal_lines_medium" | "circle_medium" | "flag_medium" | "waffle_medium" | "dot_medium" | "pyramid_medium" | "needle_medium" | "diamond_medium" | "pizza_medium";
|
|
27
|
+
/** @public */
|
|
22
28
|
export type ColumnLocator = IAttributeColumnLocator | IMeasureColumnLocator | ITotalColumnLocator;
|
|
29
|
+
/** @public */
|
|
23
30
|
export interface IAttributeColumnLocatorBody {
|
|
24
31
|
attributeIdentifier: string;
|
|
25
32
|
element?: string | null;
|
|
26
33
|
}
|
|
34
|
+
/** @public */
|
|
27
35
|
export interface ITotalColumnLocatorBody {
|
|
28
36
|
attributeIdentifier: string;
|
|
29
37
|
totalFunction: string;
|
|
30
38
|
}
|
|
39
|
+
/** @public */
|
|
31
40
|
export interface IAttributeColumnLocator {
|
|
32
41
|
attributeLocatorItem: IAttributeColumnLocatorBody;
|
|
33
42
|
}
|
|
43
|
+
/** @public */
|
|
34
44
|
export interface ITotalColumnLocator {
|
|
35
45
|
totalLocatorItem: ITotalColumnLocatorBody;
|
|
36
46
|
}
|
|
47
|
+
/** @public */
|
|
37
48
|
export interface IAttributeColumnWidthItem {
|
|
38
49
|
attributeColumnWidthItem: IAttributeColumnWidthItemBody;
|
|
39
50
|
}
|
|
51
|
+
/** @public */
|
|
40
52
|
export interface IAttributeColumnWidthItemBody {
|
|
41
53
|
width: IAbsoluteColumnWidth;
|
|
42
54
|
attributeIdentifier: string;
|
|
43
55
|
}
|
|
56
|
+
/** @public */
|
|
44
57
|
export interface IMeasureColumnWidthItemBody {
|
|
45
58
|
width: ColumnWidth;
|
|
46
59
|
locators: ColumnLocator[];
|
|
47
60
|
}
|
|
61
|
+
/** @public */
|
|
48
62
|
export interface IMeasureColumnWidthItem {
|
|
49
63
|
measureColumnWidthItem: IMeasureColumnWidthItemBody;
|
|
50
64
|
}
|
|
65
|
+
/** @public */
|
|
51
66
|
export interface ISliceMeasureColumnWidthItemBody {
|
|
52
67
|
width: ColumnWidth;
|
|
53
68
|
locators: IMeasureColumnLocator[];
|
|
54
69
|
}
|
|
70
|
+
/** @public */
|
|
55
71
|
export interface ISliceMeasureColumnWidthItem {
|
|
56
72
|
sliceMeasureColumnWidthItem: ISliceMeasureColumnWidthItemBody;
|
|
57
73
|
}
|
|
74
|
+
/** @public */
|
|
58
75
|
export interface IMixedValuesColumnWidthItemBody {
|
|
59
76
|
width: ColumnWidth;
|
|
60
77
|
locators: IMeasureColumnLocator[];
|
|
61
78
|
}
|
|
79
|
+
/** @public */
|
|
62
80
|
export interface IAbsoluteColumnWidth {
|
|
63
81
|
value: number;
|
|
64
82
|
allowGrowToFit?: boolean;
|
|
65
83
|
}
|
|
84
|
+
/** @public */
|
|
66
85
|
export type ColumnWidth = IAbsoluteColumnWidth | IAutoColumnWidth;
|
|
86
|
+
/** @public */
|
|
67
87
|
export interface IAutoColumnWidth {
|
|
68
88
|
value: "auto";
|
|
69
89
|
}
|
|
90
|
+
/** @public */
|
|
70
91
|
export interface IMixedValuesColumnWidthItem {
|
|
71
92
|
mixedValuesColumnWidthItem: IMixedValuesColumnWidthItemBody;
|
|
72
93
|
}
|
|
94
|
+
/** @public */
|
|
73
95
|
export interface IAllMeasureColumnWidthItemBody {
|
|
74
96
|
width: IAbsoluteColumnWidth;
|
|
75
97
|
}
|
|
98
|
+
/** @public */
|
|
76
99
|
export interface IAllMeasureColumnWidthItem {
|
|
77
100
|
measureColumnWidthItem: IAllMeasureColumnWidthItemBody;
|
|
78
101
|
}
|
|
102
|
+
/** @public */
|
|
79
103
|
export interface IWeakMeasureColumnWidthItemBody {
|
|
80
104
|
width: IAbsoluteColumnWidth;
|
|
81
105
|
locator: IMeasureColumnLocator;
|
|
82
106
|
}
|
|
107
|
+
/** @public */
|
|
83
108
|
export interface IWeakMeasureColumnWidthItem {
|
|
84
109
|
measureColumnWidthItem: IWeakMeasureColumnWidthItemBody;
|
|
85
110
|
}
|
|
111
|
+
/** @public */
|
|
86
112
|
export interface IMeasureColumnLocatorBody {
|
|
87
113
|
measureIdentifier: string;
|
|
88
114
|
}
|
|
115
|
+
/** @public */
|
|
89
116
|
export interface IMeasureColumnLocator {
|
|
90
117
|
measureLocatorItem: IMeasureColumnLocatorBody;
|
|
91
118
|
}
|
|
119
|
+
/** @public */
|
|
92
120
|
export type ColumnWidthItem = IAttributeColumnWidthItem | IMeasureColumnWidthItem | ISliceMeasureColumnWidthItem | IMixedValuesColumnWidthItem | IAllMeasureColumnWidthItem | IWeakMeasureColumnWidthItem;
|
package/esm/configs/utils.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Visualisation } from "@gooddata/sdk-code-schemas/v1";
|
|
2
2
|
import { type ChartFillType, type ColorMapping, type PatternFillName } from "./types.js";
|
|
3
3
|
import { type ConfigDefaults, type VisualisationConfig } from "./utils.js";
|
|
4
|
-
|
|
4
|
+
/** @internal */
|
|
5
|
+
export type WaterfallChartConfigProperties = {
|
|
5
6
|
colorMapping: Array<ColorMapping>;
|
|
6
7
|
dataLabels: {
|
|
7
8
|
visible: boolean | "auto";
|
|
@@ -50,8 +51,12 @@ type DefaultProperties = {
|
|
|
50
51
|
disableAlerts: boolean;
|
|
51
52
|
disableScheduledExports: boolean;
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
-
declare
|
|
54
|
+
/** @internal */
|
|
55
|
+
export declare const WATERFALL_CHART_DEFAULTS: ConfigDefaults<WaterfallChartConfigProperties>;
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare function waterfallChartLoad(props: VisualisationConfig<WaterfallChartConfigProperties>): import("yaml").Pair<import("yaml").Scalar<string>, any> | null;
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare function waterfallChartSave(_fields: Visualisation["query"]["fields"] | undefined, config: Visualisation["config"] | undefined): {
|
|
55
60
|
colorMapping: ColorMapping[] | undefined;
|
|
56
61
|
dataLabels: {
|
|
57
62
|
visible: "auto" | boolean | undefined;
|
|
@@ -100,9 +105,17 @@ declare function save(_fields: Visualisation["query"]["fields"] | undefined, con
|
|
|
100
105
|
disableAlerts: boolean | undefined;
|
|
101
106
|
disableScheduledExports: boolean | undefined;
|
|
102
107
|
} | undefined;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
* @deprecated Use waterfallChartLoad and waterfallChartSave instead.
|
|
111
|
+
*/
|
|
112
|
+
export interface IWaterfallChartConfig {
|
|
113
|
+
load: typeof waterfallChartLoad;
|
|
114
|
+
save: typeof waterfallChartSave;
|
|
115
|
+
DEFAULTS: ConfigDefaults<WaterfallChartConfigProperties>;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
* @deprecated Use waterfallChartLoad and waterfallChartSave instead.
|
|
120
|
+
*/
|
|
121
|
+
export declare const waterfallChart: IWaterfallChartConfig;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
2
|
import { loadChartFill, loadColorDefinitions, saveChartFill, saveColorDefinitions, } from "../utils/configUtils.js";
|
|
3
3
|
import { getValueOrDefault, loadConfig, saveConfigObject, } from "./utils.js";
|
|
4
|
+
/** @internal */
|
|
4
5
|
const DEFAULTS = {
|
|
5
6
|
colorMapping: [],
|
|
6
7
|
dataLabels: {
|
|
@@ -49,7 +50,10 @@ const DEFAULTS = {
|
|
|
49
50
|
disableAlerts: false,
|
|
50
51
|
disableScheduledExports: false,
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const WATERFALL_CHART_DEFAULTS = DEFAULTS;
|
|
55
|
+
/** @internal */
|
|
56
|
+
export function waterfallChartLoad(props) {
|
|
53
57
|
return loadConfig(props, (key, value) => {
|
|
54
58
|
switch (key) {
|
|
55
59
|
case "colorMapping":
|
|
@@ -155,7 +159,8 @@ function load(props) {
|
|
|
155
159
|
}
|
|
156
160
|
});
|
|
157
161
|
}
|
|
158
|
-
|
|
162
|
+
/** @internal */
|
|
163
|
+
export function waterfallChartSave(_fields, config) {
|
|
159
164
|
if (!config) {
|
|
160
165
|
return undefined;
|
|
161
166
|
}
|
|
@@ -206,8 +211,12 @@ function save(_fields, config) {
|
|
|
206
211
|
disableScheduledExports: getValueOrDefault(config.disable_scheduled_exports, DEFAULTS.disableScheduledExports, "bool"),
|
|
207
212
|
});
|
|
208
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
* @deprecated Use waterfallChartLoad and waterfallChartSave instead.
|
|
217
|
+
*/
|
|
209
218
|
export const waterfallChart = {
|
|
210
|
-
load,
|
|
211
|
-
save,
|
|
219
|
+
load: waterfallChartLoad,
|
|
220
|
+
save: waterfallChartSave,
|
|
212
221
|
DEFAULTS,
|
|
213
222
|
};
|
package/esm/conts.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
/** @internal */
|
|
1
2
|
export declare const DatasetTypes: string[];
|
|
3
|
+
/** @internal */
|
|
2
4
|
export declare const DateDatasetTypes: string[];
|
|
5
|
+
/** @internal */
|
|
3
6
|
export declare const MetricTypes: string[];
|
|
7
|
+
/** @internal */
|
|
4
8
|
export declare const DashboardTypes: string[];
|
|
9
|
+
/** @internal */
|
|
5
10
|
export declare const PluginTypes: string[];
|
|
11
|
+
/** @internal */
|
|
6
12
|
export declare const AttributeHierarchyTypes: string[];
|
|
13
|
+
/** @internal */
|
|
7
14
|
export declare const VisualisationsTypes: string[];
|
|
15
|
+
/** @internal */
|
|
8
16
|
export declare const AllTypes: string[];
|
package/esm/conts.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
|
+
/** @internal */
|
|
2
3
|
export const DatasetTypes = ["dataset"];
|
|
4
|
+
/** @internal */
|
|
3
5
|
export const DateDatasetTypes = ["date"];
|
|
6
|
+
/** @internal */
|
|
4
7
|
export const MetricTypes = ["metric"];
|
|
8
|
+
/** @internal */
|
|
5
9
|
export const DashboardTypes = ["dashboard"];
|
|
10
|
+
/** @internal */
|
|
6
11
|
export const PluginTypes = ["plugin"];
|
|
12
|
+
/** @internal */
|
|
7
13
|
export const AttributeHierarchyTypes = ["attribute_hierarchy"];
|
|
14
|
+
/** @internal */
|
|
8
15
|
export const VisualisationsTypes = [
|
|
9
16
|
"table",
|
|
10
17
|
"bar_chart",
|
|
@@ -29,6 +36,7 @@ export const VisualisationsTypes = [
|
|
|
29
36
|
"geo_area_chart",
|
|
30
37
|
"repeater_chart",
|
|
31
38
|
];
|
|
39
|
+
/** @internal */
|
|
32
40
|
export const AllTypes = [
|
|
33
41
|
...DatasetTypes,
|
|
34
42
|
...DateDatasetTypes,
|
|
@@ -4,6 +4,7 @@ import type { Dashboard } from "@gooddata/sdk-code-schemas/v1";
|
|
|
4
4
|
import { type IDashboardAttributeFilterConfig, type IDashboardDateFilterConfig, type IDashboardDateFilterConfigItem, type IDashboardDefinition, type IDashboardLayout, type IDashboardLayoutItem, type IDashboardLayoutWidget, type IDashboardMeasureValueFilterConfig, type IDashboardWidget, type IDrillDownIntersectionIgnoredAttributes, type IDrillDownReference, type IFilterContextDefinition, type IInsightWidget, type IRichTextWidget, type IVisualizationSwitcherWidget, type InsightDrillDefinition } from "@gooddata/sdk-model";
|
|
5
5
|
import { type DashboardTab, type FromEntities } from "../types.js";
|
|
6
6
|
import { type IErrorContext } from "../utils/errors.js";
|
|
7
|
+
/** @internal */
|
|
7
8
|
export type OverrideDashboardDefinition = Omit<IDashboardDefinition, "filterContext"> & {
|
|
8
9
|
filterContextRef?: AfmObjectIdentifier;
|
|
9
10
|
tabs?: DashboardTab[];
|
|
@@ -14,8 +15,11 @@ export declare function declarativeDashboardToYaml(entities: FromEntities, dashb
|
|
|
14
15
|
content: string;
|
|
15
16
|
json: Dashboard;
|
|
16
17
|
};
|
|
18
|
+
/** @internal */
|
|
17
19
|
export declare function declarativeTabsToYaml(tabs: DashboardTab[], filterContexts?: DeclarativeFilterContext[], entities?: FromEntities, errorContext?: IErrorContext): YAMLSeq | undefined;
|
|
20
|
+
/** @internal */
|
|
18
21
|
export declare function declarativeSectionsToYaml(layout?: IDashboardLayout, entities?: FromEntities, errorContext?: IErrorContext): YAMLSeq<unknown> | undefined;
|
|
22
|
+
/** @internal */
|
|
19
23
|
export declare function declarativeWidgetToYaml(widget?: IDashboardWidget | null, size?: IDashboardLayoutItem["size"], entities?: FromEntities, errorContext?: IErrorContext): YAMLMap<unknown, unknown> | undefined;
|
|
20
24
|
export declare function declarativeInsightWidgetToYaml(widget: IInsightWidget, size?: IDashboardLayoutItem["size"], entities?: FromEntities, errorContext?: IErrorContext): YAMLMap<unknown, unknown>;
|
|
21
25
|
export declare function declarativeIgnoreDrillDownHierarchyToYaml(hierarchy: IDrillDownReference, errorContext?: IErrorContext): {
|
|
@@ -42,18 +46,23 @@ export declare function declarativeDrillDownIntersectionIgnoredAttributesToYaml(
|
|
|
42
46
|
export declare function declarativeRichTextWidgetToYaml(widget: IRichTextWidget, size?: IDashboardLayoutItem["size"]): YAMLMap<unknown, unknown>;
|
|
43
47
|
export declare function declarativeVisualizationSwitcherWidgetToYaml(widget: IVisualizationSwitcherWidget, size?: IDashboardLayoutItem["size"], entities?: FromEntities, errorContext?: IErrorContext): YAMLMap<unknown, unknown>;
|
|
44
48
|
export declare function declarativeContainerWidgetToYaml(widget: IDashboardLayoutWidget, size?: IDashboardLayoutItem["size"], entities?: FromEntities, errorContext?: IErrorContext): YAMLMap<unknown, unknown>;
|
|
49
|
+
/** @internal */
|
|
45
50
|
export declare function declarativeDrillToYaml(drill: InsightDrillDefinition, entities?: FromEntities, sourceVisualizationId?: string, errorContext?: IErrorContext): YAMLMap<unknown, unknown>;
|
|
51
|
+
/** @internal */
|
|
46
52
|
export type FilterContextItem = {
|
|
47
53
|
yaml: YAMLMap;
|
|
48
54
|
filter: IFilterContextDefinition["filters"][number];
|
|
49
55
|
};
|
|
56
|
+
/** @internal */
|
|
50
57
|
export declare function declarativeFilterContextToYaml(dateFilterConfig?: IDashboardDateFilterConfig, filterContext?: DeclarativeFilterContext, errorContext?: IErrorContext): {
|
|
51
58
|
filters: YAMLMap<unknown, unknown>;
|
|
52
59
|
filtersMap: {
|
|
53
60
|
[key: string]: FilterContextItem;
|
|
54
61
|
};
|
|
55
62
|
};
|
|
63
|
+
/** @internal */
|
|
56
64
|
export declare function declarativeFiltersConfigToYaml(filtersMap: Record<string, FilterContextItem>, dateFilterConfig?: IDashboardDateFilterConfig, dateFilterConfigs?: IDashboardDateFilterConfigItem[], attributeFilterConfigs?: IDashboardAttributeFilterConfig[], measureValueFilterConfigs?: IDashboardMeasureValueFilterConfig[], errorContext?: IErrorContext): void;
|
|
57
65
|
export declare function declarativeFilterGroupsToYaml(filters: YAMLMap, filterGroupsConfig?: DashboardTab["filterGroupsConfig"]): YAMLMap;
|
|
66
|
+
/** @internal */
|
|
58
67
|
export declare function declarativePluginsToYaml(dashboard: IDashboardDefinition, errorContext?: IErrorContext): YAMLSeq<unknown> | undefined;
|
|
59
68
|
export declare function declarativePermissionsToYaml(doc: Document, dashboard: DeclarativeAnalyticalDashboard | DeclarativeAnalyticalDashboardExtension): YAMLMap<import("yaml").Scalar<string> | import("yaml").Scalar<number>, import("yaml").Scalar<undefined> | YAMLMap<import("yaml").Scalar<"all"> | import("yaml").Scalar<"user_groups"> | import("yaml").Scalar<"users">, import("yaml").Scalar<undefined> | import("yaml").Scalar<false> | import("yaml").Scalar<true> | YAMLSeq<import("yaml").Scalar<string>>>> | undefined;
|
|
@@ -106,6 +106,7 @@ export function declarativeDashboardToYaml(entities, dashboard, filterContexts,
|
|
|
106
106
|
json: doc.toJSON(),
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
+
/** @internal */
|
|
109
110
|
export function declarativeTabsToYaml(tabs, filterContexts, entities, errorContext) {
|
|
110
111
|
// no tabs
|
|
111
112
|
if (!tabs || tabs.length === 0) {
|
|
@@ -146,6 +147,7 @@ export function declarativeTabsToYaml(tabs, filterContexts, entities, errorConte
|
|
|
146
147
|
});
|
|
147
148
|
return yamlTabs;
|
|
148
149
|
}
|
|
150
|
+
/** @internal */
|
|
149
151
|
export function declarativeSectionsToYaml(layout, entities, errorContext) {
|
|
150
152
|
//no sections at all
|
|
151
153
|
if (!layout?.sections?.length) {
|
|
@@ -175,6 +177,7 @@ export function declarativeSectionsToYaml(layout, entities, errorContext) {
|
|
|
175
177
|
});
|
|
176
178
|
return sections;
|
|
177
179
|
}
|
|
180
|
+
/** @internal */
|
|
178
181
|
export function declarativeWidgetToYaml(widget, size, entities, errorContext) {
|
|
179
182
|
if (!widget) {
|
|
180
183
|
return;
|
|
@@ -368,6 +371,7 @@ export function declarativeContainerWidgetToYaml(widget, size, entities, errorCo
|
|
|
368
371
|
}
|
|
369
372
|
return yamlWidget;
|
|
370
373
|
}
|
|
374
|
+
/** @internal */
|
|
371
375
|
export function declarativeDrillToYaml(drill, entities, sourceVisualizationId, errorContext) {
|
|
372
376
|
const drillYaml = new YAMLMap();
|
|
373
377
|
const originIdentifier = drill.origin.type === "drillFromMeasure" ? drill.origin.measure : drill.origin.attribute;
|
|
@@ -509,6 +513,7 @@ function getDateFilterEmptyValueHandling(filter) {
|
|
|
509
513
|
}
|
|
510
514
|
return undefined;
|
|
511
515
|
}
|
|
516
|
+
/** @internal */
|
|
512
517
|
export function declarativeFilterContextToYaml(dateFilterConfig, filterContext, errorContext) {
|
|
513
518
|
const filters = [];
|
|
514
519
|
const filtersMap = {};
|
|
@@ -757,6 +762,7 @@ function declarativeMeasureValueFilterToYaml(filter, errorContext) {
|
|
|
757
762
|
}
|
|
758
763
|
return measureValueFilter;
|
|
759
764
|
}
|
|
765
|
+
/** @internal */
|
|
760
766
|
export function declarativeFiltersConfigToYaml(filtersMap, dateFilterConfig, dateFilterConfigs, attributeFilterConfigs, measureValueFilterConfigs, errorContext) {
|
|
761
767
|
attributeFilterConfigs?.forEach((filterSettings, i) => {
|
|
762
768
|
const filter = filtersMap[filterSettings.localIdentifier];
|
|
@@ -877,6 +883,7 @@ function getFilterGroupIdBase({ title, localIdentifier }) {
|
|
|
877
883
|
.replace(/[^a-zA-Z0-9]/g, "_")
|
|
878
884
|
.toLowerCase();
|
|
879
885
|
}
|
|
886
|
+
/** @internal */
|
|
880
887
|
export function declarativePluginsToYaml(dashboard, errorContext) {
|
|
881
888
|
if (!dashboard.plugins?.length) {
|
|
882
889
|
return;
|
|
@@ -9,62 +9,92 @@ export declare function declarativeVisualisationToYaml(entities: FromEntities, v
|
|
|
9
9
|
content: string;
|
|
10
10
|
json?: Visualisation;
|
|
11
11
|
};
|
|
12
|
-
export declare function declarativeFiltersConfigToYaml(insight: IInsightDefinition["insight"], filtersMap: Record<string,
|
|
12
|
+
export declare function declarativeFiltersConfigToYaml(insight: IInsightDefinition["insight"], filtersMap: Record<string, YamlFilterMapEntry>, errorContext?: IErrorContext): void;
|
|
13
|
+
/** @internal */
|
|
13
14
|
export declare function declarativeVisTypeToYaml(def: IInsightDefinition["insight"]): string | null;
|
|
14
|
-
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type YamlPostProcessors = {
|
|
15
17
|
filters: Array<{
|
|
16
18
|
item: YAMLMap;
|
|
17
19
|
filters: IFilter[];
|
|
18
20
|
}>;
|
|
19
21
|
};
|
|
20
|
-
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type YamlBuckets = {
|
|
21
24
|
fieldsMap: YAMLMap;
|
|
22
|
-
groups:
|
|
23
|
-
postProcessors:
|
|
25
|
+
groups: YamlBucketGroup[];
|
|
26
|
+
postProcessors: YamlPostProcessors;
|
|
24
27
|
};
|
|
25
|
-
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type YamlBucketGroupItems = Array<{
|
|
26
30
|
field: string;
|
|
27
31
|
format?: string;
|
|
28
32
|
totals?: YAMLMap[];
|
|
29
33
|
axis?: "primary" | "secondary";
|
|
30
34
|
display_as?: "metric" | "line" | "column";
|
|
31
35
|
} | null>;
|
|
32
|
-
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type YamlBucketGroup = {
|
|
33
38
|
type: BucketsType;
|
|
34
|
-
items:
|
|
39
|
+
items: YamlBucketGroupItems;
|
|
35
40
|
};
|
|
36
|
-
|
|
41
|
+
/** @internal */
|
|
42
|
+
export type YamlFieldData = {
|
|
43
|
+
format?: string;
|
|
44
|
+
axis?: "primary" | "secondary";
|
|
45
|
+
};
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare function declarativeBucketsToYaml(entities: FromEntities, buckets: IBucket[], errorContext?: IErrorContext): YamlBuckets;
|
|
48
|
+
/** @internal */
|
|
37
49
|
export declare function declarativeAttributeToYaml(def: IAttributeBody, errorContext?: IErrorContext): YAMLMap;
|
|
50
|
+
/** @internal */
|
|
38
51
|
export declare function declarativeInlineMetricToYaml(def: IMeasureBody, inlineDef: IInlineMeasureDefinition): YAMLMap;
|
|
39
|
-
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare function declarativeNormalMetricToYaml(def: IMeasureBody, metricDefinition: IMeasureDefinition, postProcessors: YamlPostProcessors, errorContext?: IErrorContext): YAMLMap;
|
|
54
|
+
/** @internal */
|
|
40
55
|
export declare function declarativeArithmeticMetricToYaml(def: IMeasureBody, arithmeticDefinition: IArithmeticMeasureDefinition): YAMLMap;
|
|
56
|
+
/** @internal */
|
|
41
57
|
export declare function declarativePoPMetricToYaml(def: IMeasureBody, popDefinition: IPoPMeasureDefinition, errorContext?: IErrorContext): YAMLMap;
|
|
58
|
+
/** @internal */
|
|
42
59
|
export declare function declarativePreviousPeriodMetricToYaml(def: IMeasureBody, previousDefinition: IPreviousPeriodMeasureDefinition, errorContext?: IErrorContext): YAMLMap;
|
|
43
|
-
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type YamlFilterMapEntry = {
|
|
44
62
|
yaml: YAMLMap;
|
|
45
63
|
filter: IFilter;
|
|
46
64
|
};
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
/** @internal */
|
|
66
|
+
export type YamlFilters = {
|
|
67
|
+
filtersMap: Record<string, YamlFilterMapEntry>;
|
|
49
68
|
filtersArray: YAMLMap;
|
|
50
69
|
};
|
|
51
|
-
|
|
70
|
+
/** @internal */
|
|
71
|
+
export declare function declarativeFiltersToYaml(entities: FromEntities, filters: IFilter[], errorContext?: IErrorContext): YamlFilters;
|
|
72
|
+
/** @internal */
|
|
52
73
|
export declare function declarativeAbsoluteDateFilterToYaml(absoluteDateFilter: IAbsoluteDateFilter["absoluteDateFilter"], connectedAttributeFilters: IFilter[] | undefined, entities: FromEntities, getUniqueKey: (baseKey: string) => string, errorContext?: IErrorContext): YAMLMap;
|
|
74
|
+
/** @internal */
|
|
53
75
|
export declare function declarativeRelativeDateFilterToYaml(relativeDateFilter: IRelativeDateFilter["relativeDateFilter"], connectedAttributeFilters: IFilter[] | undefined, entities: FromEntities, getUniqueKey: (baseKey: string) => string, errorContext?: IErrorContext): YAMLMap;
|
|
76
|
+
/** @internal */
|
|
54
77
|
export declare function declarativePositiveAttributeFilterToYaml(entities: FromEntities, attributeFilter: IPositiveAttributeFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
78
|
+
/** @internal */
|
|
55
79
|
export declare function declarativeNegativeAttributeFilterToYaml(entities: FromEntities, attributeFilter: INegativeAttributeFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
56
80
|
export declare function declarativeArbitraryAttributeFilterToYaml(attributeFilter: IArbitraryAttributeFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
57
81
|
export declare function declarativeMatchAttributeFilterToYaml(attributeFilter: IMatchAttributeFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
82
|
+
/** @internal */
|
|
58
83
|
export declare function declarativeMeasureValueFilterToYaml(measureValueFilter: IMeasureValueFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
84
|
+
/** @internal */
|
|
59
85
|
export declare function declarativeRankingFilterToYaml(rankingFilter: IRankingFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
60
|
-
|
|
86
|
+
/** @internal */
|
|
87
|
+
export type YamlSorts = {
|
|
61
88
|
sortsArray: YAMLMap[];
|
|
62
89
|
};
|
|
63
|
-
|
|
90
|
+
/** @internal */
|
|
91
|
+
export declare function declarativeSortsToYaml(sorts: ISortItem[], _errorContext?: IErrorContext): YamlSorts;
|
|
92
|
+
/** @internal */
|
|
64
93
|
export declare function declarativeAttributeSortToYaml(sort: IAttributeSortItem): YAMLMap;
|
|
94
|
+
/** @internal */
|
|
65
95
|
export declare function declarativeMeasureSortToYaml(sort: IMeasureSortItem): YAMLMap;
|
|
96
|
+
/** @internal */
|
|
66
97
|
export declare function declarativeTotalToYaml(total: ITotal, _errorContext?: IErrorContext): {
|
|
67
98
|
totalMap: YAMLMap<unknown, unknown>;
|
|
68
99
|
attribute: string;
|
|
69
100
|
};
|
|
70
|
-
export {};
|
|
@@ -188,6 +188,7 @@ export function declarativeFiltersConfigToYaml(insight, filtersMap, errorContext
|
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
+
/** @internal */
|
|
191
192
|
export function declarativeVisTypeToYaml(def) {
|
|
192
193
|
switch (def.visualizationUrl) {
|
|
193
194
|
case "local:table":
|
|
@@ -316,6 +317,7 @@ function declarativeVisToYaml(doc, def, report, entities, errorContext) {
|
|
|
316
317
|
break;
|
|
317
318
|
}
|
|
318
319
|
}
|
|
320
|
+
/** @internal */
|
|
319
321
|
export function declarativeBucketsToYaml(entities, buckets, errorContext) {
|
|
320
322
|
const fullFieldsMap = new YAMLMap();
|
|
321
323
|
const groups = [];
|
|
@@ -426,6 +428,7 @@ export function declarativeBucketsToYaml(entities, buckets, errorContext) {
|
|
|
426
428
|
postProcessors,
|
|
427
429
|
};
|
|
428
430
|
}
|
|
431
|
+
/** @internal */
|
|
429
432
|
export function declarativeAttributeToYaml(def, errorContext) {
|
|
430
433
|
const map = new YAMLMap();
|
|
431
434
|
if (def.alias) {
|
|
@@ -440,6 +443,7 @@ export function declarativeAttributeToYaml(def, errorContext) {
|
|
|
440
443
|
}
|
|
441
444
|
return map;
|
|
442
445
|
}
|
|
446
|
+
/** @internal */
|
|
443
447
|
export function declarativeInlineMetricToYaml(def, inlineDef) {
|
|
444
448
|
const map = new YAMLMap();
|
|
445
449
|
fillDefaultMetricProperties(map, def);
|
|
@@ -447,6 +451,7 @@ export function declarativeInlineMetricToYaml(def, inlineDef) {
|
|
|
447
451
|
map.add(new Pair("maql", id.maql));
|
|
448
452
|
return map;
|
|
449
453
|
}
|
|
454
|
+
/** @internal */
|
|
450
455
|
export function declarativeNormalMetricToYaml(def, metricDefinition, postProcessors, errorContext) {
|
|
451
456
|
const map = new YAMLMap();
|
|
452
457
|
fillDefaultMetricProperties(map, def);
|
|
@@ -466,6 +471,7 @@ export function declarativeNormalMetricToYaml(def, metricDefinition, postProcess
|
|
|
466
471
|
map.add(new Pair("using", id));
|
|
467
472
|
return map;
|
|
468
473
|
}
|
|
474
|
+
/** @internal */
|
|
469
475
|
export function declarativeArithmeticMetricToYaml(def, arithmeticDefinition) {
|
|
470
476
|
const map = new YAMLMap();
|
|
471
477
|
fillDefaultMetricProperties(map, def);
|
|
@@ -474,6 +480,7 @@ export function declarativeArithmeticMetricToYaml(def, arithmeticDefinition) {
|
|
|
474
480
|
map.add(new Pair("using", ad.measureIdentifiers));
|
|
475
481
|
return map;
|
|
476
482
|
}
|
|
483
|
+
/** @internal */
|
|
477
484
|
export function declarativePoPMetricToYaml(def, popDefinition, errorContext) {
|
|
478
485
|
const map = new YAMLMap();
|
|
479
486
|
fillDefaultMetricProperties(map, def);
|
|
@@ -487,6 +494,7 @@ export function declarativePoPMetricToYaml(def, popDefinition, errorContext) {
|
|
|
487
494
|
map.add(new Pair("using", pop.measureIdentifier));
|
|
488
495
|
return map;
|
|
489
496
|
}
|
|
497
|
+
/** @internal */
|
|
490
498
|
export function declarativePreviousPeriodMetricToYaml(def, previousDefinition, errorContext) {
|
|
491
499
|
const map = new YAMLMap();
|
|
492
500
|
fillDefaultMetricProperties(map, def);
|
|
@@ -622,6 +630,7 @@ function groupFiltersByDateFilter(filters) {
|
|
|
622
630
|
});
|
|
623
631
|
return result;
|
|
624
632
|
}
|
|
633
|
+
/** @internal */
|
|
625
634
|
export function declarativeFiltersToYaml(entities, filters, errorContext) {
|
|
626
635
|
const filtersArray = [];
|
|
627
636
|
const filtersMap = {};
|
|
@@ -778,6 +787,7 @@ function processConnectedAttributeFilters(map, connectedAttributeFilters, entiti
|
|
|
778
787
|
withMap.add(new Pair(converted.key, converted.yaml));
|
|
779
788
|
});
|
|
780
789
|
}
|
|
790
|
+
/** @internal */
|
|
781
791
|
export function declarativeAbsoluteDateFilterToYaml(absoluteDateFilter, connectedAttributeFilters = [], entities, getUniqueKey, errorContext) {
|
|
782
792
|
const map = new YAMLMap();
|
|
783
793
|
// base date filter attributes
|
|
@@ -801,6 +811,7 @@ function isRelativeDateFilterAllTime(relativeDateFilter) {
|
|
|
801
811
|
// But unfortunately AD emits granularity as GDC.time.year for an all time date filter, so we need this check as well
|
|
802
812
|
return granularity === "GDC.time.year" && from === undefined && to === undefined;
|
|
803
813
|
}
|
|
814
|
+
/** @internal */
|
|
804
815
|
export function declarativeRelativeDateFilterToYaml(relativeDateFilter, connectedAttributeFilters = [], entities, getUniqueKey, errorContext) {
|
|
805
816
|
const map = new YAMLMap();
|
|
806
817
|
map.add(new Pair("type", "date_filter"));
|
|
@@ -825,6 +836,7 @@ export function declarativeRelativeDateFilterToYaml(relativeDateFilter, connecte
|
|
|
825
836
|
processConnectedAttributeFilters(map, connectedAttributeFilters, entities, getUniqueKey, errorContext);
|
|
826
837
|
return map;
|
|
827
838
|
}
|
|
839
|
+
/** @internal */
|
|
828
840
|
export function declarativePositiveAttributeFilterToYaml(entities, attributeFilter, errorContext) {
|
|
829
841
|
const map = new YAMLMap();
|
|
830
842
|
map.add(new Pair("type", "attribute_filter"));
|
|
@@ -840,6 +852,7 @@ export function declarativePositiveAttributeFilterToYaml(entities, attributeFilt
|
|
|
840
852
|
}
|
|
841
853
|
return map;
|
|
842
854
|
}
|
|
855
|
+
/** @internal */
|
|
843
856
|
export function declarativeNegativeAttributeFilterToYaml(entities, attributeFilter, errorContext) {
|
|
844
857
|
const map = new YAMLMap();
|
|
845
858
|
map.add(new Pair("type", "attribute_filter"));
|
|
@@ -916,6 +929,7 @@ function addConditionToYamlMap(conditionMap, condition) {
|
|
|
916
929
|
}
|
|
917
930
|
return hasTreatNullValues;
|
|
918
931
|
}
|
|
932
|
+
/** @internal */
|
|
919
933
|
export function declarativeMeasureValueFilterToYaml(measureValueFilter, errorContext) {
|
|
920
934
|
const map = new YAMLMap();
|
|
921
935
|
map.add(new Pair("type", "metric_value_filter"));
|
|
@@ -967,6 +981,7 @@ export function declarativeMeasureValueFilterToYaml(measureValueFilter, errorCon
|
|
|
967
981
|
}
|
|
968
982
|
return map;
|
|
969
983
|
}
|
|
984
|
+
/** @internal */
|
|
970
985
|
export function declarativeRankingFilterToYaml(rankingFilter, errorContext) {
|
|
971
986
|
const map = new YAMLMap();
|
|
972
987
|
map.add(new Pair("type", "ranking_filter"));
|
|
@@ -996,6 +1011,7 @@ export function declarativeRankingFilterToYaml(rankingFilter, errorContext) {
|
|
|
996
1011
|
}
|
|
997
1012
|
return map;
|
|
998
1013
|
}
|
|
1014
|
+
/** @internal */
|
|
999
1015
|
export function declarativeSortsToYaml(sorts, _errorContext) {
|
|
1000
1016
|
const sortsArray = [];
|
|
1001
1017
|
sorts.forEach((sort) => {
|
|
@@ -1010,6 +1026,7 @@ export function declarativeSortsToYaml(sorts, _errorContext) {
|
|
|
1010
1026
|
sortsArray,
|
|
1011
1027
|
};
|
|
1012
1028
|
}
|
|
1029
|
+
/** @internal */
|
|
1013
1030
|
export function declarativeAttributeSortToYaml(sort) {
|
|
1014
1031
|
const { attributeIdentifier, aggregation, direction } = sort.attributeSortItem;
|
|
1015
1032
|
const map = new YAMLMap();
|
|
@@ -1021,6 +1038,7 @@ export function declarativeAttributeSortToYaml(sort) {
|
|
|
1021
1038
|
}
|
|
1022
1039
|
return map;
|
|
1023
1040
|
}
|
|
1041
|
+
/** @internal */
|
|
1024
1042
|
export function declarativeMeasureSortToYaml(sort) {
|
|
1025
1043
|
const { locators, direction } = sort.measureSortItem;
|
|
1026
1044
|
const map = new YAMLMap();
|
|
@@ -1509,6 +1527,7 @@ function declarativeVisRepeaterToYaml(doc, def, report, _errorContext) {
|
|
|
1509
1527
|
}
|
|
1510
1528
|
}
|
|
1511
1529
|
//TOTALS
|
|
1530
|
+
/** @internal */
|
|
1512
1531
|
export function declarativeTotalToYaml(total, _errorContext) {
|
|
1513
1532
|
const map = new YAMLMap();
|
|
1514
1533
|
if (total.alias) {
|