@gooddata/sdk-backend-tiger 11.37.0-alpha.5 → 11.37.0

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.37.0-alpha.5";
1
+ export declare const LIB_VERSION = "11.37.0";
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.37.0-alpha.5";
3
+ export const LIB_VERSION = "11.37.0";
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";
@@ -26,6 +26,13 @@ const normalizeExportDefinitionSettings = (settings) => {
26
26
  ...(orientation ? { orientation } : {}),
27
27
  };
28
28
  };
29
+ // Accepts either ITigerFilterContextItem (our manual wire shape, used in the toBackend direction
30
+ // where we control the localIdentifier) or the BE-generated DashboardFilter (which allows a missing
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.
29
36
  const convertTigerToDashboardFilters = (filters) => convertTigerToSdkFilters(filters);
30
37
  export const wrapExportDefinition = (requestPayload, metadata) => {
31
38
  const id = uuid();
@@ -1,5 +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
4
  import { cloneWithSanitizedIdsTyped as cloneWithSanitizedIdsTypedFromBackend } from "../fromBackend/IdSanitization.js";
4
5
  import { cloneWithSanitizedIdsTyped as cloneWithSanitizedIdsTypedToBackend } from "../toBackend/IdSanitization.js";
5
6
  import { convertMeasureValueFilterSdkToTiger, convertMeasureValueFilterTigerToSdk, } from "./measureValueFilterConverter.js";
@@ -29,8 +30,59 @@ export function convertSdkFilterToTigerStored(filter) {
29
30
  * @public
30
31
  */
31
32
  export function convertSdkFilterContextItemToTiger(item) {
33
+ if (isDashboardMatchAttributeFilter(item)) {
34
+ return cloneWithSanitizedIdsTypedToBackend({
35
+ matchAttributeFilter: {
36
+ ...item.matchAttributeFilter,
37
+ caseSensitive: item.matchAttributeFilter.caseSensitive ?? false,
38
+ negativeSelection: item.matchAttributeFilter.negativeSelection ?? false,
39
+ },
40
+ });
41
+ }
42
+ if (isDashboardMeasureValueFilter(item)) {
43
+ return cloneWithSanitizedIdsTypedToBackend(normalizeDashboardMvfForTiger(item));
44
+ }
32
45
  return cloneWithSanitizedIdsTypedToBackend(item);
33
46
  }
47
+ /**
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.
56
+ */
57
+ function normalizeDashboardMvfForTiger(filter) {
58
+ const { conditions, ...rest } = filter.dashboardMeasureValueFilter;
59
+ const treatNullValuesAs = conditions ? firstDefinedTreatNullValuesAs(conditions) : undefined;
60
+ const cleanConditions = conditions?.map(toCompoundConditionItem) ?? [];
61
+ return {
62
+ dashboardMeasureValueFilter: {
63
+ ...rest,
64
+ conditions: cleanConditions,
65
+ ...(treatNullValuesAs === undefined ? {} : { treatNullValuesAs }),
66
+ },
67
+ };
68
+ }
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
+ function toCompoundConditionItem(c) {
81
+ if (isComparisonCondition(c)) {
82
+ return { comparison: { operator: c.comparison.operator, value: c.comparison.value } };
83
+ }
84
+ return { range: { operator: c.range.operator, from: c.range.from, to: c.range.to } };
85
+ }
34
86
  // Tiger -> SDK
35
87
  /**
36
88
  * Converts Tiger stored filter to SDK filter format.
@@ -52,8 +104,34 @@ export function convertTigerStoredToSdkFilter(filter) {
52
104
  * @public
53
105
  */
54
106
  function convertDashboardFilterToSdk(item) {
107
+ if ("dashboardMeasureValueFilter" in item) {
108
+ return cloneWithSanitizedIdsTypedFromBackend(denormalizeDashboardMvfFromTiger(item));
109
+ }
55
110
  return cloneWithSanitizedIdsTypedFromBackend(item);
56
111
  }
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
+ }
57
135
  export function convertSdkFiltersToTiger(filters) {
58
136
  if (!filters) {
59
137
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-backend-tiger",
3
- "version": "11.37.0-alpha.5",
3
+ "version": "11.37.0",
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/api-client-tiger": "11.37.0-alpha.5",
37
- "@gooddata/sdk-backend-base": "11.37.0-alpha.5",
38
- "@gooddata/sdk-backend-spi": "11.37.0-alpha.5",
39
- "@gooddata/sdk-code-convertors": "11.37.0-alpha.5",
40
- "@gooddata/sdk-model": "11.37.0-alpha.5",
41
- "@gooddata/util": "11.37.0-alpha.5"
36
+ "@gooddata/sdk-backend-spi": "11.37.0",
37
+ "@gooddata/sdk-backend-base": "11.37.0",
38
+ "@gooddata/sdk-model": "11.37.0",
39
+ "@gooddata/api-client-tiger": "11.37.0",
40
+ "@gooddata/util": "11.37.0",
41
+ "@gooddata/sdk-code-convertors": "11.37.0"
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.37.0-alpha.5",
69
- "@gooddata/eslint-config": "11.37.0-alpha.5",
70
- "@gooddata/oxlint-config": "11.37.0-alpha.5",
71
- "@gooddata/reference-workspace": "11.37.0-alpha.5"
68
+ "@gooddata/eslint-config": "11.37.0",
69
+ "@gooddata/catalog-export": "11.37.0",
70
+ "@gooddata/oxlint-config": "11.37.0",
71
+ "@gooddata/reference-workspace": "11.37.0"
72
72
  },
73
73
  "scripts": {
74
74
  "_phase:build": "npm run build",