@gooddata/sdk-code-convertors 11.66.0 → 11.67.0-alpha.1
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/execution/buildAfmExecution.d.ts.map +1 -1
- package/esm/execution/buildAfmExecution.js +33 -3
- package/esm/from/declarativeDashboardToYaml.js +2 -2
- package/esm/sdk-code-convertors.d.ts +1 -1
- package/esm/to/yamlDashboardToDeclarative.d.ts +1 -1
- package/esm/to/yamlDashboardToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlDashboardToDeclarative.js +4 -4
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildAfmExecution.d.ts","sourceRoot":"","sources":["../../src/execution/buildAfmExecution.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"buildAfmExecution.d.ts","sourceRoot":"","sources":["../../src/execution/buildAfmExecution.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGR,KAAK,EAIR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA2C3E,cAAc;AACd,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,GAAG,kBAAkB,CAkB5F"}
|
|
@@ -3,7 +3,7 @@ import { convertBucketToTitle } from "../utils/convertBucketToTitle.js";
|
|
|
3
3
|
import { mapDateAttribute, mapDateDataset } from "../utils/dateUtils.js";
|
|
4
4
|
import { parseDateValues, yamlConditionToMatch } from "../utils/filterUtils.js";
|
|
5
5
|
import { getFullField } from "../utils/sharedUtils.js";
|
|
6
|
-
import { isAbsoluteDateFilter, isArbitraryTextFilter, isArithmeticMetricField, isAttributeField, isAttributeSort, isCalculatedMetricField, isComputedAttributeReference, isInlineMetricField, isMatchTextFilter, isMetricAllValueFilter, isMetricComparisonValueFilter, isMetricField, isMetricRangeValueFilter, isMetricValueFilterWithConditions, isNegativeAttributeFilter, isPoPMetricField, isPositiveAttributeFilter, isPreviousPeriodField, isRankingFilter, isRelativeDateFilter, isSimpleMetricSort, } from "../utils/typeGuards.js";
|
|
6
|
+
import { isAbsoluteDateFilter, isAllTimeDateFilter, isArbitraryTextFilter, isArithmeticMetricField, isAttributeField, isAttributeSort, isCalculatedMetricField, isComputedAttributeReference, isInlineMetricField, isMatchTextFilter, isMetricAllValueFilter, isMetricComparisonValueFilter, isMetricField, isMetricRangeValueFilter, isMetricValueFilterWithConditions, isNegativeAttributeFilter, isPoPMetricField, isPositiveAttributeFilter, isPreviousPeriodField, isRankingFilter, isRelativeDateFilter, isSimpleMetricSort, } from "../utils/typeGuards.js";
|
|
7
7
|
import { createIdentifier, createLocalIdentifier } from "../utils/yamlUtils.js";
|
|
8
8
|
const MATCH_OPERATOR_TO_AFM = {
|
|
9
9
|
startsWith: "STARTS_WITH",
|
|
@@ -184,11 +184,26 @@ function buildDimensions(query, execution) {
|
|
|
184
184
|
sorting,
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* `empty_values` is the date filter's own mode; the AFM spells it in upper case.
|
|
189
|
+
*/
|
|
190
|
+
function dateFilterEmptyValueHandling(filter) {
|
|
191
|
+
const { empty_values } = filter;
|
|
192
|
+
return empty_values === "include" || empty_values === "exclude" || empty_values === "only"
|
|
193
|
+
? { emptyValueHandling: empty_values.toUpperCase() }
|
|
194
|
+
: {};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Converts AaC `filter_by` into AFM filters for the query preview.
|
|
198
|
+
*
|
|
199
|
+
* sdk-backend-tiger's `convertFilter` converts the equivalent model filters for a stored insight. When
|
|
200
|
+
* you add or change a date filter property here, change it there too, and extend
|
|
201
|
+
* `AacFilterParity.test.ts` in sdk-backend-tiger, which fails if the two diverge.
|
|
202
|
+
*/
|
|
187
203
|
function buildFilters(entities, filters_by) {
|
|
188
204
|
if (!filters_by) {
|
|
189
205
|
return [];
|
|
190
206
|
}
|
|
191
|
-
// TODO
|
|
192
207
|
const filters = [];
|
|
193
208
|
Object.keys(filters_by ?? {}).forEach((key) => {
|
|
194
209
|
const filter = filters_by[key];
|
|
@@ -198,10 +213,24 @@ function buildFilters(entities, filters_by) {
|
|
|
198
213
|
dataset: createIdentifier(filter.using, { forceType: "dataset" }),
|
|
199
214
|
from: filter.from,
|
|
200
215
|
to: filter.to,
|
|
216
|
+
...dateFilterEmptyValueHandling(filter),
|
|
201
217
|
},
|
|
202
218
|
});
|
|
203
219
|
}
|
|
204
|
-
if (
|
|
220
|
+
if (isAllTimeDateFilter(filter)) {
|
|
221
|
+
// Mirrors convertFilter in sdk-backend-tiger: All time only has an effect with an empty
|
|
222
|
+
// values mode that filters, anything else is a no-op and is not sent. The relative filter
|
|
223
|
+
// is not an option, it requires from/to/granularity.
|
|
224
|
+
if (filter.empty_values === "exclude" || filter.empty_values === "only") {
|
|
225
|
+
filters.push({
|
|
226
|
+
allTimeDateFilter: {
|
|
227
|
+
dataset: createIdentifier(filter.using, { forceType: "dataset" }),
|
|
228
|
+
...dateFilterEmptyValueHandling(filter),
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
else if (isRelativeDateFilter(filter)) {
|
|
205
234
|
filters.push({
|
|
206
235
|
relativeDateFilter: {
|
|
207
236
|
dataset: createIdentifier(filter.using, { forceType: "dataset" }),
|
|
@@ -209,6 +238,7 @@ function buildFilters(entities, filters_by) {
|
|
|
209
238
|
undefined),
|
|
210
239
|
from: filter.from,
|
|
211
240
|
to: filter.to,
|
|
241
|
+
...dateFilterEmptyValueHandling(filter),
|
|
212
242
|
},
|
|
213
243
|
});
|
|
214
244
|
}
|
|
@@ -54,8 +54,8 @@ export function declarativeDashboardToYaml(entities, dashboard, filterContexts,
|
|
|
54
54
|
if (content.disableFilterViews) {
|
|
55
55
|
doc.add(entryWithSpace("filter_views", false));
|
|
56
56
|
}
|
|
57
|
-
if (content.
|
|
58
|
-
doc.add(entryWithSpace("persistent_filters_across_tabs",
|
|
57
|
+
if (typeof content.enablePersistentFiltersAcrossTabs === "boolean") {
|
|
58
|
+
doc.add(entryWithSpace("persistent_filters_across_tabs", content.enablePersistentFiltersAcrossTabs));
|
|
59
59
|
}
|
|
60
60
|
if (content.timezoneConfig) {
|
|
61
61
|
doc.add(entryWithSpace("timezone_config", declarativeTimezoneConfigToYaml(content.timezoneConfig)));
|
|
@@ -1366,7 +1366,7 @@ export declare interface CustomTooltip {
|
|
|
1366
1366
|
export declare type CustomTooltipPlacement = "above" | "below" | "replace";
|
|
1367
1367
|
|
|
1368
1368
|
/** @internal */
|
|
1369
|
-
export declare type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "timezoneConfig" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "
|
|
1369
|
+
export declare type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "timezoneConfig" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "enablePersistentFiltersAcrossTabs" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
1370
1370
|
version: string;
|
|
1371
1371
|
};
|
|
1372
1372
|
|
|
@@ -4,7 +4,7 @@ import { type IDashboardAttributeFilterConfig, type IDashboardDateFilter, type I
|
|
|
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" | "timezoneConfig" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "
|
|
7
|
+
export type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "timezoneConfig" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "enablePersistentFiltersAcrossTabs" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
8
8
|
version: string;
|
|
9
9
|
};
|
|
10
10
|
/** @internal */
|
|
@@ -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,EAE7B,KAAK,wBAAwB,EAIhC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AA+BrE,gBAAgB;AAChB,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAClC,2BAA2B,EACzB,QAAQ,GACR,SAAS,GACT,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,oBAAoB,GACpB,
|
|
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,EAE7B,KAAK,wBAAwB,EAIhC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AA+BrE,gBAAgB;AAChB,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAClC,2BAA2B,EACzB,QAAQ,GACR,SAAS,GACT,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,oBAAoB,GACpB,mCAAmC,GACnC,wBAAwB,GACxB,2BAA2B,GAC3B,kBAAkB,GAClB,MAAM,GACN,0BAA0B,CAC/B,GAAG;IACA,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAIF,gBAAgB;AAChB,MAAM,MAAM,uBAAuB,GAAG,I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AW,GACnB,eAAe,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,IAAI,CA6FvF;AA4HD,gBAAgB;AAChB,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI,CAuB9F;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,sCAErE;AA6FD,gBAAgB;AAChB,wBAAgB,8BAA8B,CAC1C,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,gBAAgB,GAAG,SAAS,GAC1C;IACC,aAAa,EAAE,wBAAwB,CAAC;IACxC,gBAAgB,EAAE,0BAA0B,GAAG,SAAS,CAAC;IACzD,iBAAiB,EAAE,8BAA8B,EAAE,GAAG,SAAS,CAAC;IAChE,sBAAsB,EAAE,+BAA+B,EAAE,GAAG,SAAS,CAAC;IACtE,yBAAyB,EAAE,kCAAkC,EAAE,GAAG,SAAS,CAAC;IAC5E,kBAAkB,EAAE,4BAA4B,GAAG,SAAS,CAAC;CAChE,CAuVA"}
|
|
@@ -177,8 +177,8 @@ export function yamlDashboardToDeclarative(entities, input) {
|
|
|
177
177
|
...(input.user_filters_save === false ? { disableUserFilterSave: true } : {}),
|
|
178
178
|
...(input.user_filters_reset === false ? { disableUserFilterReset: true } : {}),
|
|
179
179
|
...(input.filter_views === false ? { disableFilterViews: true } : {}),
|
|
180
|
-
...(input.persistent_filters_across_tabs ===
|
|
181
|
-
? {
|
|
180
|
+
...(typeof input.persistent_filters_across_tabs === "boolean"
|
|
181
|
+
? { enablePersistentFiltersAcrossTabs: input.persistent_filters_across_tabs }
|
|
182
182
|
: {}),
|
|
183
183
|
}
|
|
184
184
|
: {
|
|
@@ -195,8 +195,8 @@ export function yamlDashboardToDeclarative(entities, input) {
|
|
|
195
195
|
...(input.user_filters_save === false ? { disableUserFilterSave: true } : {}),
|
|
196
196
|
...(input.user_filters_reset === false ? { disableUserFilterReset: true } : {}),
|
|
197
197
|
...(input.filter_views === false ? { disableFilterViews: true } : {}),
|
|
198
|
-
...(input.persistent_filters_across_tabs ===
|
|
199
|
-
? {
|
|
198
|
+
...(typeof input.persistent_filters_across_tabs === "boolean"
|
|
199
|
+
? { enablePersistentFiltersAcrossTabs: input.persistent_filters_across_tabs }
|
|
200
200
|
: {}),
|
|
201
201
|
filterContextRef: filterContext
|
|
202
202
|
? createIdentifier(filterContext.id, { forceType: "filterContext" })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-code-convertors",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.67.0-alpha.1",
|
|
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.
|
|
30
|
-
"@gooddata/sdk-code-schemas": "11.
|
|
31
|
-
"@gooddata/sdk-model": "11.
|
|
29
|
+
"@gooddata/api-client-tiger": "11.67.0-alpha.1",
|
|
30
|
+
"@gooddata/sdk-code-schemas": "11.67.0-alpha.1",
|
|
31
|
+
"@gooddata/sdk-model": "11.67.0-alpha.1"
|
|
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": "5.0.4",
|
|
51
|
-
"@gooddata/
|
|
52
|
-
"@gooddata/
|
|
51
|
+
"@gooddata/eslint-config": "11.67.0-alpha.1",
|
|
52
|
+
"@gooddata/oxlint-config": "11.67.0-alpha.1"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"_phase:build": "npm run build",
|