@gooddata/sdk-backend-tiger 11.39.0-alpha.2 → 11.39.0-alpha.4

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.
@@ -1,3 +1,3 @@
1
- export declare const LIB_VERSION = "11.39.0-alpha.2";
1
+ export declare const LIB_VERSION = "11.39.0-alpha.4";
2
2
  export declare const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
3
3
  export declare const LIB_NAME = "@gooddata/sdk-backend-tiger";
package/esm/__version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // (C) 2021 GoodData Corporation
2
2
  // DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
3
- export const LIB_VERSION = "11.39.0-alpha.2";
3
+ export const LIB_VERSION = "11.39.0-alpha.4";
4
4
  export const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
5
5
  export const LIB_NAME = "@gooddata/sdk-backend-tiger";
@@ -1,6 +1,6 @@
1
1
  // (C) 2024-2026 GoodData Corporation
2
2
  import { compact } from "lodash-es";
3
- import { filterAttributeElements, filterLocalIdentifier, filterObjRef, idRef, isAbsoluteDateFilter, isAllTimeDateFilter, isArbitraryAttributeFilter, isAttributeFilterWithSelection, isAutomationUserRecipient, isExportDefinitionVisualizationObjectRequestPayload, isFilter, isFilterContextItem, isMatchAttributeFilter, isMeasureValueFilter, isNegativeAttributeFilter, isObjRef, isRelativeBoundedDateFilter, isRelativeDateFilter, measureValueFilterConditions, measureValueFilterMeasure, newAbsoluteDashboardDateFilter, newAllTimeDashboardDateFilter, newRelativeDashboardDateFilter, } from "@gooddata/sdk-model";
3
+ import { filterAttributeElements, filterLocalIdentifier, filterObjRef, idRef, isAbsoluteDateFilter, isAllTimeDateFilter, isArbitraryAttributeFilter, isAttributeFilterWithSelection, isAutomationUserRecipient, isExportDefinitionVisualizationObjectRequestPayload, isFilter, isFilterContextItem, isMatchAttributeFilter, isMeasureValueFilter, isNegativeAttributeFilter, isObjRef, isRelativeBoundedDateFilter, isRelativeDateFilter, measureValueFilterConditions, measureValueFilterDimensionality, measureValueFilterMeasure, newAbsoluteDashboardDateFilter, newAllTimeDashboardDateFilter, newRelativeDashboardDateFilter, } from "@gooddata/sdk-model";
4
4
  import { fixNumber } from "../../utils/fixNumber.js";
5
5
  import { convertFilter } from "./afm/FilterConverter.js";
6
6
  import { convertMeasure } from "./afm/MeasureConverter.js";
@@ -339,6 +339,7 @@ export function convertExecutionFilterToFilterContextItem(filter, fallbackLocalI
339
339
  }
340
340
  const body = filter.measureValueFilter;
341
341
  const conditions = measureValueFilterConditions(filter);
342
+ const dimensionality = measureValueFilterDimensionality(filter)?.filter(isObjRef);
342
343
  // The SDK execution-side body does not declare `title`, but inputs may carry one at runtime
343
344
  // (e.g. exports coming from a richer source). Propagate it if present.
344
345
  const title = "title" in body ? body.title : undefined;
@@ -347,6 +348,7 @@ export function convertExecutionFilterToFilterContextItem(filter, fallbackLocalI
347
348
  measure,
348
349
  localIdentifier: body.localIdentifier ?? fallbackLocalIdentifier,
349
350
  ...(conditions ? { conditions } : {}),
351
+ ...(dimensionality && dimensionality.length > 0 ? { dimensionality } : {}),
350
352
  ...(title ? { title } : {}),
351
353
  },
352
354
  };
@@ -29,10 +29,6 @@ const normalizeExportDefinitionSettings = (settings) => {
29
29
  // Accepts either ITigerFilterContextItem (our manual wire shape, used in the toBackend direction
30
30
  // where we control the localIdentifier) or the BE-generated DashboardFilter (which allows a missing
31
31
  // localIdentifier on the MVF). The runtime helper matches structurally so the wider input works.
32
- //
33
- // TODO INE: wait for BE type unification — once `DashboardMeasureValueFilter` aligns with our
34
- // manual type (`localIdentifier` required), drop the `| DashboardFilter[]` branch and the cast;
35
- // `ITigerFilterContextItem[] | undefined` will accept BE-shaped data again.
36
32
  const convertTigerToDashboardFilters = (filters) => convertTigerToSdkFilters(filters);
37
33
  export const wrapExportDefinition = (requestPayload, metadata) => {
38
34
  const id = uuid();
@@ -1,6 +1,6 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { isTigerFilterContextItems, isTigerFilters, } from "@gooddata/api-client-tiger";
3
- import { isComparisonCondition, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, isRangeCondition, } from "@gooddata/sdk-model";
3
+ import { isComparisonCondition, isDashboardMatchAttributeFilter, isDashboardMeasureValueFilter, } from "@gooddata/sdk-model";
4
4
  import { cloneWithSanitizedIdsTyped as cloneWithSanitizedIdsTypedFromBackend } from "../fromBackend/IdSanitization.js";
5
5
  import { cloneWithSanitizedIdsTyped as cloneWithSanitizedIdsTypedToBackend } from "../toBackend/IdSanitization.js";
6
6
  import { convertMeasureValueFilterSdkToTiger, convertMeasureValueFilterTigerToSdk, } from "./measureValueFilterConverter.js";
@@ -46,42 +46,39 @@ export function convertSdkFilterContextItemToTiger(item) {
46
46
  }
47
47
  /**
48
48
  * Reshapes an sdk-model `IDashboardMeasureValueFilter` for the Tiger wire:
49
- * - lifts the per-condition `treatNullValuesAs` onto the filter body (first defined value wins, matching
50
- * how AFM-compound MVF is handled — see `convertMeasureValueFilterSdkToTiger`),
51
- * - strips the field from each inner condition so they match the BE's `DashboardCompoundConditionItem`.
52
- *
53
- * The BE schema does not currently have a slot for `treatNullValuesAs` on `dashboardMeasureValueFilter`;
54
- * this is a forward-looking placement that pairs with the matching client type extension. Until the BE
55
- * adds the field, requests carrying it will be rejected — that's tracked separately.
49
+ * - keeps per-condition `treatNullValuesAs` on each comparison/range condition, matching the
50
+ * published `DashboardCompoundConditionItem` schema.
56
51
  */
57
52
  function normalizeDashboardMvfForTiger(filter) {
58
53
  const { conditions, ...rest } = filter.dashboardMeasureValueFilter;
59
- const treatNullValuesAs = conditions ? firstDefinedTreatNullValuesAs(conditions) : undefined;
60
54
  const cleanConditions = conditions?.map(toCompoundConditionItem) ?? [];
61
55
  return {
62
56
  dashboardMeasureValueFilter: {
63
57
  ...rest,
64
58
  conditions: cleanConditions,
65
- ...(treatNullValuesAs === undefined ? {} : { treatNullValuesAs }),
66
59
  },
67
60
  };
68
61
  }
69
- function firstDefinedTreatNullValuesAs(conditions) {
70
- for (const c of conditions) {
71
- if (isComparisonCondition(c) && c.comparison.treatNullValuesAs !== undefined) {
72
- return c.comparison.treatNullValuesAs;
73
- }
74
- if (isRangeCondition(c) && c.range.treatNullValuesAs !== undefined) {
75
- return c.range.treatNullValuesAs;
76
- }
77
- }
78
- return undefined;
79
- }
80
62
  function toCompoundConditionItem(c) {
81
63
  if (isComparisonCondition(c)) {
82
- return { comparison: { operator: c.comparison.operator, value: c.comparison.value } };
64
+ const { operator, value, treatNullValuesAs } = c.comparison;
65
+ return {
66
+ comparison: {
67
+ operator,
68
+ value,
69
+ ...(treatNullValuesAs === undefined ? {} : { treatNullValuesAs }),
70
+ },
71
+ };
83
72
  }
84
- return { range: { operator: c.range.operator, from: c.range.from, to: c.range.to } };
73
+ const { operator, from, to, treatNullValuesAs } = c.range;
74
+ return {
75
+ range: {
76
+ operator,
77
+ from,
78
+ to,
79
+ ...(treatNullValuesAs === undefined ? {} : { treatNullValuesAs }),
80
+ },
81
+ };
85
82
  }
86
83
  // Tiger -> SDK
87
84
  /**
@@ -105,33 +102,10 @@ export function convertTigerStoredToSdkFilter(filter) {
105
102
  */
106
103
  function convertDashboardFilterToSdk(item) {
107
104
  if ("dashboardMeasureValueFilter" in item) {
108
- return cloneWithSanitizedIdsTypedFromBackend(denormalizeDashboardMvfFromTiger(item));
105
+ return cloneWithSanitizedIdsTypedFromBackend(item);
109
106
  }
110
107
  return cloneWithSanitizedIdsTypedFromBackend(item);
111
108
  }
112
- /**
113
- * Reverse of {@link normalizeDashboardMvfForTiger}: spreads the body-level `treatNullValuesAs` back onto
114
- * each inner condition's `comparison`/`range` so the result matches the sdk-model `IDashboardMeasureValueFilter`.
115
- */
116
- function denormalizeDashboardMvfFromTiger(item) {
117
- const { treatNullValuesAs, conditions, ...rest } = item.dashboardMeasureValueFilter;
118
- const denormalizedConditions = (conditions ?? []).map((c) => spreadTreatNullValuesAs(c, treatNullValuesAs));
119
- return {
120
- dashboardMeasureValueFilter: {
121
- ...rest,
122
- conditions: denormalizedConditions,
123
- },
124
- };
125
- }
126
- function spreadTreatNullValuesAs(c, treatNullValuesAs) {
127
- if (treatNullValuesAs === undefined) {
128
- return c;
129
- }
130
- if (isComparisonCondition(c)) {
131
- return { comparison: { ...c.comparison, treatNullValuesAs } };
132
- }
133
- return { range: { ...c.range, treatNullValuesAs } };
134
- }
135
109
  export function convertSdkFiltersToTiger(filters) {
136
110
  if (!filters) {
137
111
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-backend-tiger",
3
- "version": "11.39.0-alpha.2",
3
+ "version": "11.39.0-alpha.4",
4
4
  "description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -33,12 +33,12 @@
33
33
  "ts-invariant": "0.10.3",
34
34
  "tslib": "2.8.1",
35
35
  "uuid": "11.1.0",
36
- "@gooddata/sdk-backend-base": "11.39.0-alpha.2",
37
- "@gooddata/api-client-tiger": "11.39.0-alpha.2",
38
- "@gooddata/sdk-backend-spi": "11.39.0-alpha.2",
39
- "@gooddata/sdk-code-convertors": "11.39.0-alpha.2",
40
- "@gooddata/sdk-model": "11.39.0-alpha.2",
41
- "@gooddata/util": "11.39.0-alpha.2"
36
+ "@gooddata/api-client-tiger": "11.39.0-alpha.4",
37
+ "@gooddata/sdk-backend-spi": "11.39.0-alpha.4",
38
+ "@gooddata/sdk-backend-base": "11.39.0-alpha.4",
39
+ "@gooddata/sdk-code-convertors": "11.39.0-alpha.4",
40
+ "@gooddata/sdk-model": "11.39.0-alpha.4",
41
+ "@gooddata/util": "11.39.0-alpha.4"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@gooddata/fixtures": "3.3.12",
@@ -65,10 +65,10 @@
65
65
  "oxlint-tsgolint": "0.11.4",
66
66
  "typescript": "5.9.3",
67
67
  "vitest": "4.1.0",
68
- "@gooddata/catalog-export": "11.39.0-alpha.2",
69
- "@gooddata/eslint-config": "11.39.0-alpha.2",
70
- "@gooddata/reference-workspace": "11.39.0-alpha.2",
71
- "@gooddata/oxlint-config": "11.39.0-alpha.2"
68
+ "@gooddata/eslint-config": "11.39.0-alpha.4",
69
+ "@gooddata/oxlint-config": "11.39.0-alpha.4",
70
+ "@gooddata/catalog-export": "11.39.0-alpha.4",
71
+ "@gooddata/reference-workspace": "11.39.0-alpha.4"
72
72
  },
73
73
  "scripts": {
74
74
  "_phase:build": "npm run build",