@gooddata/sdk-embedding 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.
@@ -131,7 +131,13 @@ export interface IRankingFilter {
131
131
  * references are not supported). When the dashboard holds multiple MVFs for the same metric,
132
132
  * `localIdentifier` disambiguates which one is targeted; without it the dashboard matches by
133
133
  * metric only and silently ignores the change if more than one filter exists for that metric.
134
- * Conditions are OR-ed; an empty array (or omitted property) clears the filter.
134
+ * Conditions are OR-ed; an empty array (or omitted property) clears the filter. `dimensionality`
135
+ * can define the dashboard-level granularity for the MVF; an empty array clears it.
136
+ *
137
+ * `treatNullValuesAs` is a filter-level convenience: when set, NULL metric values are treated as
138
+ * the given number for every condition that does not define its own `treatNullValuesAs`. The
139
+ * underlying model represents this per condition, so the value is folded into the conditions when
140
+ * the command is translated.
135
141
  *
136
142
  * @public
137
143
  */
@@ -140,6 +146,8 @@ export interface IMeasureValueFilter {
140
146
  measure: IObjIdentifierQualifier;
141
147
  localIdentifier?: string;
142
148
  conditions?: MeasureValueFilterCondition[];
149
+ dimensionality?: ObjQualifier[];
150
+ treatNullValuesAs?: number;
143
151
  };
144
152
  }
145
153
  /**
@@ -31,6 +31,7 @@ export interface ITransformedMeasureValueFilter {
31
31
  measureIdentifier: string;
32
32
  localIdentifier?: string;
33
33
  conditions?: MeasureValueFilterCondition[];
34
+ dimensionality?: ObjQualifier[];
34
35
  }
35
36
  export interface ITransformedDateFilterItem {
36
37
  granularity?: string;
@@ -108,14 +108,24 @@ function isValidMeasureValueFilterCondition(condition) {
108
108
  }
109
109
  return false;
110
110
  }
111
+ function isValidMeasureValueFilterDimensionality(dimensionality) {
112
+ return (Array.isArray(dimensionality) &&
113
+ dimensionality.every((item) => {
114
+ const { uri, identifier } = getObjectUriIdentifier(item);
115
+ return typeof uri === "string" || typeof identifier === "string";
116
+ }));
117
+ }
111
118
  function isValidMeasureValueFilterFormat(filterItem) {
112
- const { measure, localIdentifier, conditions } = filterItem.measureValueFilter;
119
+ const { measure, localIdentifier, conditions, dimensionality, treatNullValuesAs } = filterItem.measureValueFilter;
113
120
  if (isEmpty(measure) || !isObjIdentifierQualifier(measure)) {
114
121
  return false;
115
122
  }
116
123
  if (localIdentifier !== undefined && typeof localIdentifier !== "string") {
117
124
  return false;
118
125
  }
126
+ if (treatNullValuesAs !== undefined && typeof treatNullValuesAs !== "number") {
127
+ return false;
128
+ }
119
129
  // Omitted or empty `conditions` clears the filter; otherwise every entry must be a valid condition.
120
130
  if (conditions !== undefined) {
121
131
  if (!Array.isArray(conditions)) {
@@ -125,6 +135,9 @@ function isValidMeasureValueFilterFormat(filterItem) {
125
135
  return false;
126
136
  }
127
137
  }
138
+ if (dimensionality !== undefined && !isValidMeasureValueFilterDimensionality(dimensionality)) {
139
+ return false;
140
+ }
128
141
  return true;
129
142
  }
130
143
  const VALID_MATCH_OPERATORS = ["contains", "startsWith", "endsWith"];
@@ -289,11 +302,12 @@ function transformRankingFilterItem(rankingFilterItem) {
289
302
  };
290
303
  }
291
304
  function transformMeasureValueFilterItem(measureValueFilterItem) {
292
- const { measure, localIdentifier, conditions } = measureValueFilterItem.measureValueFilter;
305
+ const { measure, localIdentifier, conditions, dimensionality } = measureValueFilterItem.measureValueFilter;
293
306
  return {
294
307
  measureIdentifier: measure.identifier,
295
308
  ...(localIdentifier ? { localIdentifier } : {}),
296
309
  ...(conditions && conditions.length > 0 ? { conditions } : {}),
310
+ ...(dimensionality && dimensionality.length > 0 ? { dimensionality } : {}),
297
311
  };
298
312
  }
299
313
  export function transformFilterContext(filters) {
@@ -1883,7 +1883,13 @@ export declare interface IMeasureContent {
1883
1883
  * references are not supported). When the dashboard holds multiple MVFs for the same metric,
1884
1884
  * `localIdentifier` disambiguates which one is targeted; without it the dashboard matches by
1885
1885
  * metric only and silently ignores the change if more than one filter exists for that metric.
1886
- * Conditions are OR-ed; an empty array (or omitted property) clears the filter.
1886
+ * Conditions are OR-ed; an empty array (or omitted property) clears the filter. `dimensionality`
1887
+ * can define the dashboard-level granularity for the MVF; an empty array clears it.
1888
+ *
1889
+ * `treatNullValuesAs` is a filter-level convenience: when set, NULL metric values are treated as
1890
+ * the given number for every condition that does not define its own `treatNullValuesAs`. The
1891
+ * underlying model represents this per condition, so the value is folded into the conditions when
1892
+ * the command is translated.
1887
1893
  *
1888
1894
  * @public
1889
1895
  */
@@ -1892,6 +1898,8 @@ export declare interface IMeasureValueFilter {
1892
1898
  measure: IObjIdentifierQualifier;
1893
1899
  localIdentifier?: string;
1894
1900
  conditions?: MeasureValueFilterCondition[];
1901
+ dimensionality?: ObjQualifier[];
1902
+ treatNullValuesAs?: number;
1895
1903
  };
1896
1904
  }
1897
1905
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-embedding",
3
- "version": "11.39.0-alpha.2",
3
+ "version": "11.39.0-alpha.4",
4
4
  "description": "GoodData Embedding APIs",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -29,7 +29,7 @@
29
29
  "lodash-es": "^4.17.23",
30
30
  "ts-invariant": "0.10.3",
31
31
  "tslib": "2.8.1",
32
- "@gooddata/sdk-model": "11.39.0-alpha.2"
32
+ "@gooddata/sdk-model": "11.39.0-alpha.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@microsoft/api-documenter": "^7.17.0",
@@ -53,8 +53,8 @@
53
53
  "oxlint-tsgolint": "0.11.4",
54
54
  "typescript": "5.9.3",
55
55
  "vitest": "4.1.0",
56
- "@gooddata/oxlint-config": "11.39.0-alpha.2",
57
- "@gooddata/eslint-config": "11.39.0-alpha.2"
56
+ "@gooddata/eslint-config": "11.39.0-alpha.4",
57
+ "@gooddata/oxlint-config": "11.39.0-alpha.4"
58
58
  },
59
59
  "scripts": {
60
60
  "_phase:build": "npm run build",