@gooddata/sdk-code-convertors 11.61.0-alpha.4 → 11.61.0-alpha.5
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/from/declarativeReportToYaml.d.ts.map +1 -1
- package/esm/from/declarativeReportToYaml.js +1 -0
- package/esm/to/yamlDashboardToDeclarative.d.ts +3 -1
- package/esm/to/yamlDashboardToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlDashboardToDeclarative.js +6 -2
- package/esm/to/yamlReportToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlReportToDeclarative.js +10 -7
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarativeReportToYaml.d.ts","sourceRoot":"","sources":["../../src/from/declarativeReportToYaml.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC9G,OAAO,EAEH,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAGjC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"declarativeReportToYaml.d.ts","sourceRoot":"","sources":["../../src/from/declarativeReportToYaml.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC9G,OAAO,EAEH,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAGjC,MAAM,qBAAqB,CAAC;AAuE7B,aAAa;AACb,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAoBpG;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAoBnG;AAED,aAAa;AACb,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,eAAe,GAAG,yBAAyB,GAAG;IACnG,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;CACxB,CAYA;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,iBAAiB,GAAG,2BAA2B,GAAG;IACvG,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;CAC1B,CAYA;AAED,aAAa;AACb,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,2BAA2B,GAAG;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;CAC1B,CAYA;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAE5E"}
|
|
@@ -42,6 +42,7 @@ function bodyEntries(content) {
|
|
|
42
42
|
["pages", pagesToYaml(content)],
|
|
43
43
|
["filters", filtersToYaml(content.filters)],
|
|
44
44
|
["variables", variablesToYaml(content.variables)],
|
|
45
|
+
["takeaways_instruction", content.takeawaysInstruction || undefined],
|
|
45
46
|
];
|
|
46
47
|
}
|
|
47
48
|
function toDocument(entries, comment = REPORT_COMMENT) {
|
|
@@ -1,6 +1,6 @@
|
|
|
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 IDashboardDateFilter, type IDashboardDateFilterConfig, type IDashboardDateFilterConfigItem, type IDashboardFilterGroupsConfig, type IDashboardFilterReference, type IDashboardMeasureValueFilterConfig, type IDashboardPluginLink, type IDrillToAttributeUrl, type IDrillToCustomUrl, type IDrillToDashboard, type IDrillToInsight, type IFilterContextDefinition } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IDashboardAttributeFilterConfig, type IDashboardDateFilter, type IDashboardDateFilterConfig, type IDashboardDateFilterConfigItem, type IDashboardFilterGroupsConfig, type IDashboardFilterReference, type IDashboardMeasureValueFilterConfig, type IDashboardPluginLink, type IDrillToAttributeUrl, type IDrillToCustomUrl, type IDrillToDashboard, type IDrillToInsight, type IFilterContextDefinition, type IInsightWidgetDefinition } from "@gooddata/sdk-model";
|
|
4
4
|
import { type OverrideDashboardDefinition } from "../from/declarativeDashboardToYaml.js";
|
|
5
5
|
import { type ExportEntities } from "../types.js";
|
|
6
6
|
/** @internal */
|
|
@@ -26,6 +26,8 @@ export declare function yamlDashboardToDeclarative(entities: ExportEntities, inp
|
|
|
26
26
|
/** @internal */
|
|
27
27
|
export declare function yamlWidgetItemToDeclarative(entities: ExportEntities, input: Widget, enableSectionHeaders?: boolean): DashboardWidget | null;
|
|
28
28
|
/** @internal */
|
|
29
|
+
export declare function yamlInsightWidgetToDeclarative(entities: ExportEntities, input: VisualisationWidget): IInsightWidgetDefinition;
|
|
30
|
+
/** @internal */
|
|
29
31
|
export declare function yamlWidgetToDeclarative(entities: ExportEntities, input: VisualisationWidget | RichTextWidget | VisualizationSwitcherWidget | ContainerWidget, enableSectionHeaders?: boolean): DashboardWidget["widget"];
|
|
30
32
|
/** @internal */
|
|
31
33
|
export declare function yamlInteractionToDeclarative(entities: ExportEntities, visualisation: string, input: Interaction): IDrillToInsight | IDrillToDashboard | IDrillToCustomUrl | IDrillToAttributeUrl | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yamlDashboardToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlDashboardToDeclarative.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,8BAA8B,EAGnC,KAAK,wBAAwB,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EAGT,gBAAgB,EAMhB,WAAW,EAKX,cAAc,EAId,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIH,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EAEnC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EAIzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"yamlDashboardToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlDashboardToDeclarative.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,8BAA8B,EAGnC,KAAK,wBAAwB,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EAGT,gBAAgB,EAMhB,WAAW,EAKX,cAAc,EAId,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIH,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EAEnC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EAIzB,KAAK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AS,CAAC;IAC5E,kBAAkB,EAAE,4BAA4B,GAAG,SAAS,CAAC;CAChE,CAuVA"}
|
|
@@ -268,12 +268,16 @@ function yamlSizeToDeclarative(input) {
|
|
|
268
268
|
},
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
|
|
271
|
+
/** @internal */
|
|
272
|
+
export function yamlInsightWidgetToDeclarative(entities, input) {
|
|
273
|
+
const target = entities
|
|
274
|
+
.filter((e) => VisualisationsTypes.includes(e.type))
|
|
275
|
+
.find((e) => e.id === input.visualization)?.data;
|
|
272
276
|
return {
|
|
273
277
|
...(input.id ? { localIdentifier: input.id } : {}),
|
|
274
278
|
type: "insight",
|
|
275
279
|
insight: createIdentifier(input.visualization, { forceType: "visualizationObject" }),
|
|
276
|
-
title: input.title || "",
|
|
280
|
+
title: input.title || target?.title || "",
|
|
277
281
|
description: useInherit(input.description),
|
|
278
282
|
configuration: {
|
|
279
283
|
hideTitle: input.title === false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yamlReportToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlReportToDeclarative.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"yamlReportToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlReportToDeclarative.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAkB,MAAM,+BAA+B,CAAC;AAC9G,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAIjC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAwCxD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC3C,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,aAAa,GAC7B,iBAAiB,CAWnB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,aAAa,GAAG,iBAAiB,CAYrG;AAED,aAAa;AACb,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,cAAc,EACrB,YAAY,CAAC,EAAE,aAAa,GAC7B,yBAAyB,CAS3B;AAED,aAAa;AACb,wBAAgB,gCAAgC,CAC5C,KAAK,EAAE,gBAAgB,EACvB,YAAY,CAAC,EAAE,aAAa,GAC7B,2BAA2B,CAY7B;AAED,aAAa;AACb,wBAAgB,iCAAiC,CAC7C,KAAK,EAAE,gBAAgB,EACvB,YAAY,CAAC,EAAE,aAAa,GAC7B,2BAA2B,CAW7B"}
|
|
@@ -10,16 +10,19 @@ function variablesToDeclarative(variables) {
|
|
|
10
10
|
...(variable.default === undefined ? {} : { defaultValue: variable.default }),
|
|
11
11
|
}));
|
|
12
12
|
}
|
|
13
|
-
function contentToDeclarative(
|
|
13
|
+
function contentToDeclarative(document, errorContext) {
|
|
14
14
|
// The stored content states its own version; a document states the schema's instead, so the
|
|
15
15
|
// convertor is what knows which shape it just wrote.
|
|
16
|
-
const declared = filtersToDeclarative(filters);
|
|
17
|
-
const declaredVariables = variablesToDeclarative(variables);
|
|
16
|
+
const declared = filtersToDeclarative(document.filters);
|
|
17
|
+
const declaredVariables = variablesToDeclarative(document.variables);
|
|
18
18
|
return {
|
|
19
19
|
version: "1",
|
|
20
|
-
pages: pages?.map((body) => yamlReportPageToDeclarative(body, errorContext)) ?? [],
|
|
20
|
+
pages: document.pages?.map((body) => yamlReportPageToDeclarative(body, errorContext)) ?? [],
|
|
21
21
|
...(declared === undefined ? {} : { filters: declared }),
|
|
22
22
|
...(declaredVariables === undefined ? {} : { variables: declaredVariables }),
|
|
23
|
+
...(document.takeaways_instruction === undefined
|
|
24
|
+
? {}
|
|
25
|
+
: { takeawaysInstruction: document.takeaways_instruction }),
|
|
23
26
|
};
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
@@ -37,7 +40,7 @@ export function yamlReportDocumentToDeclarative(input, errorContext) {
|
|
|
37
40
|
periodStart: input.period.start,
|
|
38
41
|
periodEnd: input.period.end,
|
|
39
42
|
...(input.variable_values === undefined ? {} : { variableValues: input.variable_values }),
|
|
40
|
-
content: contentToDeclarative(input
|
|
43
|
+
content: contentToDeclarative(input, errorContext),
|
|
41
44
|
};
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
@@ -56,7 +59,7 @@ export function yamlReportToDefinition(input, errorContext) {
|
|
|
56
59
|
periodStart: input.period.start,
|
|
57
60
|
periodEnd: input.period.end,
|
|
58
61
|
...(input.variable_values === undefined ? {} : { variableValues: input.variable_values }),
|
|
59
|
-
content: contentToDeclarative(input
|
|
62
|
+
content: contentToDeclarative(input, errorContext),
|
|
60
63
|
};
|
|
61
64
|
}
|
|
62
65
|
/** @alpha */
|
|
@@ -67,7 +70,7 @@ export function yamlReportTemplateToDefinition(input, errorContext) {
|
|
|
67
70
|
title: input.title ?? convertIdToTitle(input.id ?? ""),
|
|
68
71
|
...(input.description === undefined ? {} : { description: input.description }),
|
|
69
72
|
...(input.tags === undefined ? {} : { tags: input.tags }),
|
|
70
|
-
content: contentToDeclarative(input
|
|
73
|
+
content: contentToDeclarative(input, errorContext),
|
|
71
74
|
};
|
|
72
75
|
}
|
|
73
76
|
/** @alpha */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-code-convertors",
|
|
3
|
-
"version": "11.61.0-alpha.
|
|
3
|
+
"version": "11.61.0-alpha.5",
|
|
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.1",
|
|
28
28
|
"yaml": "2.8.3",
|
|
29
|
-
"@gooddata/api-client-tiger": "11.61.0-alpha.
|
|
30
|
-
"@gooddata/sdk-
|
|
31
|
-
"@gooddata/sdk-
|
|
29
|
+
"@gooddata/api-client-tiger": "11.61.0-alpha.5",
|
|
30
|
+
"@gooddata/sdk-model": "11.61.0-alpha.5",
|
|
31
|
+
"@gooddata/sdk-code-schemas": "11.61.0-alpha.5"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-extractor": "7.59.2",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"oxlint-tsgolint": "7.0.2001",
|
|
49
49
|
"typescript": "7.0.2",
|
|
50
50
|
"vitest": "4.1.11",
|
|
51
|
-
"@gooddata/
|
|
52
|
-
"@gooddata/
|
|
51
|
+
"@gooddata/eslint-config": "11.61.0-alpha.5",
|
|
52
|
+
"@gooddata/oxlint-config": "11.61.0-alpha.5"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"_phase:build": "npm run build",
|