@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,23 +1,37 @@
|
|
|
1
1
|
import { type DeclarativeAnalyticalDashboard, type DeclarativeFilterContext } from "@gooddata/api-client-tiger";
|
|
2
2
|
import type { ContainerWidget, Dashboard, DashboardFilters, Interaction, RichTextWidget, VisualisationWidget, VisualizationSwitcherWidget, Widget } from "@gooddata/sdk-code-schemas/v1";
|
|
3
|
-
import { type IDashboardAttributeFilterConfig, type IDashboardDateFilterConfig, type IDashboardDateFilterConfigItem, type IDashboardFilterGroupsConfig, type IDashboardMeasureValueFilterConfig, type IDashboardPluginLink, type IDrillToAttributeUrl, type IDrillToCustomUrl, type IDrillToDashboard, type IDrillToInsight } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IDashboardAttributeFilterConfig, type IDashboardDateFilter, type IDashboardDateFilterConfig, type IDashboardDateFilterConfigItem, type IDashboardFilterGroupsConfig, type IDashboardMeasureValueFilterConfig, type IDashboardPluginLink, type IDrillToAttributeUrl, type IDrillToCustomUrl, type IDrillToDashboard, type IDrillToInsight, type IFilterContextDefinition } from "@gooddata/sdk-model";
|
|
4
4
|
import { type OverrideDashboardDefinition } from "../from/declarativeDashboardToYaml.js";
|
|
5
5
|
import { type ExportEntities } from "../types.js";
|
|
6
|
-
|
|
6
|
+
/** @internal */
|
|
7
|
+
export type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
7
8
|
version: string;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
type
|
|
10
|
+
/** @internal */
|
|
11
|
+
export type FilterContextDefinition = Pick<IFilterContextDefinition, "filters"> & {
|
|
12
|
+
version: string;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type DashboardSection = Required<DashboardDefinition>["layout"]["sections"][number];
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type DashboardWidget = DashboardSection["items"][number];
|
|
18
|
+
/** @internal */
|
|
19
|
+
export type EmptyValueHandling = NonNullable<IDashboardDateFilter["dateFilter"]["emptyValueHandling"]>;
|
|
11
20
|
/** @public */
|
|
12
21
|
export declare function yamlDashboardToDeclarative(entities: ExportEntities, input: Dashboard): {
|
|
13
22
|
dashboard: DeclarativeAnalyticalDashboard;
|
|
14
23
|
filterContext: DeclarativeFilterContext;
|
|
15
24
|
tabFilterContexts?: DeclarativeFilterContext[];
|
|
16
25
|
};
|
|
26
|
+
/** @internal */
|
|
17
27
|
export declare function yamlWidgetItemToDeclarative(entities: ExportEntities, input: Widget, enableSectionHeaders?: boolean): DashboardWidget | null;
|
|
28
|
+
/** @internal */
|
|
18
29
|
export declare function yamlWidgetToDeclarative(entities: ExportEntities, input: VisualisationWidget | RichTextWidget | VisualizationSwitcherWidget | ContainerWidget, enableSectionHeaders?: boolean): DashboardWidget["widget"];
|
|
30
|
+
/** @internal */
|
|
19
31
|
export declare function yamlInteractionToDeclarative(entities: ExportEntities, visualisation: string, input: Interaction): IDrillToInsight | IDrillToDashboard | IDrillToCustomUrl | IDrillToAttributeUrl | null;
|
|
32
|
+
/** @internal */
|
|
20
33
|
export declare function yamlPluginsToDeclarative(plugins: Dashboard["plugins"]): IDashboardPluginLink[] | undefined;
|
|
34
|
+
/** @internal */
|
|
21
35
|
export declare function yamlFilterContextToDeclarative(baseId: string, yamlFilters: DashboardFilters | undefined): {
|
|
22
36
|
filterContext: DeclarativeFilterContext;
|
|
23
37
|
dateFilterConfig: IDashboardDateFilterConfig | undefined;
|
|
@@ -26,4 +40,3 @@ export declare function yamlFilterContextToDeclarative(baseId: string, yamlFilte
|
|
|
26
40
|
measureValueFilterConfigs: IDashboardMeasureValueFilterConfig[] | undefined;
|
|
27
41
|
filterGroupsConfig: IDashboardFilterGroupsConfig | undefined;
|
|
28
42
|
};
|
|
29
|
-
export {};
|
|
@@ -166,6 +166,7 @@ function yamlSectionToDeclarative(entities, yamlSection, enableSectionHeaders) {
|
|
|
166
166
|
.filter(Boolean),
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
+
/** @internal */
|
|
169
170
|
export function yamlWidgetItemToDeclarative(entities, input, enableSectionHeaders) {
|
|
170
171
|
const size = yamlSizeToDeclarative(input);
|
|
171
172
|
const widget = yamlWidgetToDeclarative(entities, input, enableSectionHeaders ?? true);
|
|
@@ -222,6 +223,7 @@ function yamlInsightWidgetToDeclarative(entities, input) {
|
|
|
222
223
|
...(input.ignored_cross_filtering ? { ignoreCrossFiltering: true } : {}),
|
|
223
224
|
};
|
|
224
225
|
}
|
|
226
|
+
/** @internal */
|
|
225
227
|
export function yamlWidgetToDeclarative(entities, input, enableSectionHeaders) {
|
|
226
228
|
if (isContainerWidget(input)) {
|
|
227
229
|
return {
|
|
@@ -327,6 +329,7 @@ function yamlWidgetPropertiesToDeclarative(input) {
|
|
|
327
329
|
}
|
|
328
330
|
return {};
|
|
329
331
|
}
|
|
332
|
+
/** @internal */
|
|
330
333
|
export function yamlInteractionToDeclarative(entities, visualisation, input) {
|
|
331
334
|
const target = entities
|
|
332
335
|
.filter((e) => VisualisationsTypes.includes(e.type))
|
|
@@ -506,6 +509,7 @@ function yamlIgnoredFilterToDeclarative(input) {
|
|
|
506
509
|
}
|
|
507
510
|
return null;
|
|
508
511
|
}
|
|
512
|
+
/** @internal */
|
|
509
513
|
export function yamlPluginsToDeclarative(plugins) {
|
|
510
514
|
return plugins?.map((plugin) => yamlPluginToDeclarative(plugin));
|
|
511
515
|
}
|
|
@@ -546,6 +550,7 @@ function flattenFilters(yamlFilters) {
|
|
|
546
550
|
}
|
|
547
551
|
return result;
|
|
548
552
|
}
|
|
553
|
+
/** @internal */
|
|
549
554
|
export function yamlFilterContextToDeclarative(baseId, yamlFilters) {
|
|
550
555
|
const dateFilterConfig = {};
|
|
551
556
|
const dateFilterConfigs = [];
|
|
@@ -17,6 +17,7 @@ export declare function buildGrain(entities: ExportEntities, primaryKey?: string
|
|
|
17
17
|
/**
|
|
18
18
|
* Build declarative references
|
|
19
19
|
*/
|
|
20
|
+
/** @internal */
|
|
20
21
|
export declare function buildReferences(entities: ExportEntities, refs?: Dataset["references"]): DeclarativeReference[];
|
|
21
22
|
/**
|
|
22
23
|
* Build declarative workspace data filter references
|
|
@@ -25,6 +26,7 @@ export declare function buildWorkspaceDataFilterReferences(refs?: Dataset["works
|
|
|
25
26
|
/**
|
|
26
27
|
* Build declarative facts out of AaC fields
|
|
27
28
|
*/
|
|
29
|
+
/** @internal */
|
|
28
30
|
export declare function buildFacts(fields?: Fields): DeclarativeFact[];
|
|
29
31
|
/**
|
|
30
32
|
* Build declarative aggregated facts out of AaC fields
|
|
@@ -33,8 +35,10 @@ export declare function buildAggregatedFacts(fields?: Fields, entities?: ExportE
|
|
|
33
35
|
/**
|
|
34
36
|
* Build declarative attributes out of AaC fields
|
|
35
37
|
*/
|
|
38
|
+
/** @internal */
|
|
36
39
|
export declare function buildAttributes(fields?: Fields, isAuxiliaryDataset?: boolean): DeclarativeAttribute[];
|
|
37
40
|
/**
|
|
38
41
|
* Build declarative attribute labels out of AaC labels
|
|
39
42
|
*/
|
|
43
|
+
/** @internal */
|
|
40
44
|
export declare function buildAttributeLabels(labels?: Attribute["labels"], isAuxiliaryDataset?: boolean): DeclarativeLabel[];
|
|
@@ -126,6 +126,7 @@ export function buildGrain(entities, primaryKey) {
|
|
|
126
126
|
/**
|
|
127
127
|
* Build declarative references
|
|
128
128
|
*/
|
|
129
|
+
/** @internal */
|
|
129
130
|
export function buildReferences(entities, refs = []) {
|
|
130
131
|
const datesId = entities
|
|
131
132
|
.filter((entity) => entity.type === "date")
|
|
@@ -189,6 +190,7 @@ export function buildWorkspaceDataFilterReferences(refs = []) {
|
|
|
189
190
|
/**
|
|
190
191
|
* Build declarative facts out of AaC fields
|
|
191
192
|
*/
|
|
193
|
+
/** @internal */
|
|
192
194
|
export function buildFacts(fields) {
|
|
193
195
|
if (!fields) {
|
|
194
196
|
return [];
|
|
@@ -271,6 +273,7 @@ export function buildAggregatedFacts(fields, entities = []) {
|
|
|
271
273
|
/**
|
|
272
274
|
* Build declarative attributes out of AaC fields
|
|
273
275
|
*/
|
|
276
|
+
/** @internal */
|
|
274
277
|
export function buildAttributes(fields, isAuxiliaryDataset = false) {
|
|
275
278
|
if (!fields) {
|
|
276
279
|
return [];
|
|
@@ -327,6 +330,7 @@ export function buildAttributes(fields, isAuxiliaryDataset = false) {
|
|
|
327
330
|
/**
|
|
328
331
|
* Build declarative attribute labels out of AaC labels
|
|
329
332
|
*/
|
|
333
|
+
/** @internal */
|
|
330
334
|
export function buildAttributeLabels(labels, isAuxiliaryDataset = false) {
|
|
331
335
|
if (!labels) {
|
|
332
336
|
return [];
|
|
@@ -2,13 +2,15 @@ import { type DeclarativeVisualizationObject, type JsonApiVisualizationObjectOut
|
|
|
2
2
|
import type { Filter, QueryFilters, Sorts, Total, Visualisation } from "@gooddata/sdk-code-schemas/v1";
|
|
3
3
|
import { type IAttributeFilterConfigs, type IFilter, type IInsight, type ISortItem, type ITotal } from "@gooddata/sdk-model";
|
|
4
4
|
import { type ExportEntities } from "../types.js";
|
|
5
|
-
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type VisualisationDefinition = Pick<IInsight["insight"], "visualizationUrl" | "properties" | "filters" | "buckets" | "sorts" | "attributeFilterConfigs"> & {
|
|
6
7
|
version: string;
|
|
7
8
|
};
|
|
8
9
|
/** @public */
|
|
9
10
|
export declare function yamlVisualisationToDeclarative(entities: ExportEntities, input: Visualisation): DeclarativeVisualizationObject;
|
|
10
11
|
/** @public */
|
|
11
12
|
export declare function yamlVisualisationToMetadataObject(entities: ExportEntities, input: Visualisation): JsonApiVisualizationObjectOut;
|
|
13
|
+
/** @internal */
|
|
12
14
|
export declare function yamlReportToDeclarative(entities: ExportEntities, input: Visualisation): {
|
|
13
15
|
buckets: VisualisationDefinition["buckets"];
|
|
14
16
|
sorts: VisualisationDefinition["sorts"];
|
|
@@ -19,12 +21,16 @@ export declare function yamlReportToDeclarative(entities: ExportEntities, input:
|
|
|
19
21
|
}>;
|
|
20
22
|
attributeFilterConfigs?: IAttributeFilterConfigs;
|
|
21
23
|
};
|
|
24
|
+
/** @internal */
|
|
22
25
|
export declare function yamlSortsToDeclarative(sort_by: Sorts | undefined, fields: Visualisation["query"]["fields"]): ISortItem[];
|
|
26
|
+
/** @internal */
|
|
23
27
|
export declare function yamlFiltersToDeclarative(entities: ExportEntities, filters_by: QueryFilters | Filter[] | undefined, attributeFilterConfigs?: IAttributeFilterConfigs): {
|
|
24
28
|
filters: IFilter[];
|
|
25
29
|
attributeFilterConfigs: IAttributeFilterConfigs | undefined;
|
|
26
30
|
};
|
|
31
|
+
/** @internal */
|
|
27
32
|
export declare function yamlReportTotalToDeclarative(totals: Total[] | undefined, attributeIdentifier: string): ITotal[];
|
|
33
|
+
/** @internal */
|
|
28
34
|
export declare function yamlBucketsToDeclarative(entities: ExportEntities, input: Visualisation): {
|
|
29
35
|
buckets: VisualisationDefinition["buckets"];
|
|
30
36
|
positions: Array<{
|
|
@@ -33,4 +39,3 @@ export declare function yamlBucketsToDeclarative(entities: ExportEntities, input
|
|
|
33
39
|
}>;
|
|
34
40
|
attrFilterConfig: IAttributeFilterConfigs;
|
|
35
41
|
};
|
|
36
|
-
export {};
|
|
@@ -199,6 +199,7 @@ function yamlConfigToDeclarative(def, positions) {
|
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
//REPORT
|
|
202
|
+
/** @internal */
|
|
202
203
|
export function yamlReportToDeclarative(entities, input) {
|
|
203
204
|
const { buckets, positions, attrFilterConfig } = yamlBucketsToDeclarative(entities, input);
|
|
204
205
|
const query = input.query;
|
|
@@ -435,6 +436,7 @@ function resolveField(localName, field) {
|
|
|
435
436
|
return undefined;
|
|
436
437
|
}
|
|
437
438
|
//SORTS
|
|
439
|
+
/** @internal */
|
|
438
440
|
export function yamlSortsToDeclarative(sort_by, fields) {
|
|
439
441
|
if (!sort_by) {
|
|
440
442
|
return [];
|
|
@@ -845,6 +847,7 @@ function mergeDeclarativeResults(...results) {
|
|
|
845
847
|
attributeFilterConfig: Object.assign({}, ...results.map((result) => result.attributeFilterConfig ?? {})),
|
|
846
848
|
};
|
|
847
849
|
}
|
|
850
|
+
/** @internal */
|
|
848
851
|
export function yamlFiltersToDeclarative(entities, filters_by, attributeFilterConfigs = {}) {
|
|
849
852
|
const isArray = Array.isArray(filters_by);
|
|
850
853
|
const { filters, attributeFilterConfig } = mergeDeclarativeResults({ filters: [], attributeFilterConfig: attributeFilterConfigs }, ...(filters_by && !isArray
|
|
@@ -858,6 +861,7 @@ export function yamlFiltersToDeclarative(entities, filters_by, attributeFilterCo
|
|
|
858
861
|
};
|
|
859
862
|
}
|
|
860
863
|
//TOTALS
|
|
864
|
+
/** @internal */
|
|
861
865
|
export function yamlReportTotalToDeclarative(totals = [], attributeIdentifier) {
|
|
862
866
|
return totals.map((total) => {
|
|
863
867
|
return {
|
|
@@ -869,6 +873,7 @@ export function yamlReportTotalToDeclarative(totals = [], attributeIdentifier) {
|
|
|
869
873
|
});
|
|
870
874
|
}
|
|
871
875
|
//BUCKETS
|
|
876
|
+
/** @internal */
|
|
872
877
|
export function yamlBucketsToDeclarative(entities, input) {
|
|
873
878
|
const visBuckets = mapBuckets(input);
|
|
874
879
|
const query = input.query;
|
|
@@ -17,6 +17,7 @@ export declare function convertIdToTitle(id?: string | null): string;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function convertTitleToId(title?: string | null): string;
|
|
19
19
|
export declare function convertIdOrTitleToId(id: string, title?: string | null): string;
|
|
20
|
+
/** @public */
|
|
20
21
|
export type FullFields = AttributeField | MetricField | CalculatedMetricField | InlineMetricField | ArithmeticMetricField | PoPMetricField | PreviousPeriodMetricField;
|
|
21
22
|
export declare function getFullField(field: Field): FullFields;
|
|
22
23
|
export declare function getFullBucket(bucket: Bucket): ComplexBucket;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-code-convertors",
|
|
3
|
-
"version": "11.35.0-alpha.
|
|
3
|
+
"version": "11.35.0-alpha.6",
|
|
4
4
|
"description": "GoodData AAC declarative converters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"uuid": "11.1.0",
|
|
28
28
|
"yaml": "^2.2.2",
|
|
29
|
-
"@gooddata/
|
|
30
|
-
"@gooddata/
|
|
31
|
-
"@gooddata/sdk-code-schemas": "11.35.0-alpha.
|
|
29
|
+
"@gooddata/sdk-model": "11.35.0-alpha.6",
|
|
30
|
+
"@gooddata/api-client-tiger": "11.35.0-alpha.6",
|
|
31
|
+
"@gooddata/sdk-code-schemas": "11.35.0-alpha.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-extractor": "^7.55.2",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"oxlint-tsgolint": "0.11.4",
|
|
51
51
|
"typescript": "5.9.3",
|
|
52
52
|
"vitest": "4.1.0",
|
|
53
|
-
"@gooddata/eslint-config": "11.35.0-alpha.
|
|
54
|
-
"@gooddata/oxlint-config": "11.35.0-alpha.
|
|
53
|
+
"@gooddata/eslint-config": "11.35.0-alpha.6",
|
|
54
|
+
"@gooddata/oxlint-config": "11.35.0-alpha.6"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"_phase:build": "npm run build",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"build-ts": "tsgo -p tsconfig.build.json",
|
|
64
64
|
"build-wasm": "bash wasm/build.sh",
|
|
65
65
|
"check-python-types": "node scripts/check-python-types.mjs",
|
|
66
|
-
"clean": "../../common/scripts/clean-command-state.sh && rm -rf esm coverage *.log tsconfig.tsbuildinfo",
|
|
66
|
+
"clean": "../../common/scripts/clean-command-state.sh && rm -rf esm coverage temp *.log tsconfig.tsbuildinfo",
|
|
67
67
|
"dep-cruiser": "depcruise --validate .dependency-cruiser.js --output-type err-long src/",
|
|
68
68
|
"format-check": "oxfmt --check .",
|
|
69
69
|
"format-write": "oxfmt .",
|