@sisense/sdk-data 1.19.0 → 1.20.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.
- package/dist/cjs/dimensional-model/attributes.d.ts +3 -3
- package/dist/cjs/dimensional-model/attributes.js +4 -4
- package/dist/cjs/dimensional-model/base.d.ts +10 -1
- package/dist/cjs/dimensional-model/base.js +11 -1
- package/dist/cjs/dimensional-model/filters/filters.js +4 -0
- package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.d.ts +15 -5
- package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.js +30 -9
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +3 -1
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +1 -1
- package/dist/cjs/dimensional-model/filters/utils/types.d.ts +15 -6
- package/dist/cjs/dimensional-model/interfaces.d.ts +7 -1
- package/dist/cjs/dimensional-model/measures/factory.d.ts +11 -1
- package/dist/cjs/dimensional-model/measures/factory.js +3 -2
- package/dist/cjs/dimensional-model/types.d.ts +8 -3
- package/dist/cjs/utils.d.ts +27 -2
- package/dist/cjs/utils.js +61 -2
- package/dist/dimensional-model/attributes.d.ts +3 -3
- package/dist/dimensional-model/attributes.js +4 -4
- package/dist/dimensional-model/base.d.ts +10 -1
- package/dist/dimensional-model/base.js +11 -1
- package/dist/dimensional-model/filters/filters.js +4 -0
- package/dist/dimensional-model/filters/utils/attribute-measure-util.d.ts +15 -5
- package/dist/dimensional-model/filters/utils/attribute-measure-util.js +28 -8
- package/dist/dimensional-model/filters/utils/condition-filter-util.js +3 -1
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +1 -1
- package/dist/dimensional-model/filters/utils/types.d.ts +15 -6
- package/dist/dimensional-model/interfaces.d.ts +7 -1
- package/dist/dimensional-model/measures/factory.d.ts +11 -1
- package/dist/dimensional-model/measures/factory.js +2 -2
- package/dist/dimensional-model/types.d.ts +8 -3
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -1
- package/dist/utils.d.ts +27 -2
- package/dist/utils.js +56 -1
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Element } from './interfaces.js';
|
|
2
|
+
import { JaqlDataSource } from './types.js';
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
4
5
|
*/
|
|
@@ -7,12 +8,20 @@ export declare abstract class DimensionalElement implements Element {
|
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
9
10
|
private _name;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
private readonly _dataSource;
|
|
10
15
|
/**
|
|
11
16
|
* Defines the element's name
|
|
12
17
|
*/
|
|
13
18
|
get name(): string;
|
|
14
19
|
set name(value: string);
|
|
15
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Defines the element's data source
|
|
22
|
+
*/
|
|
23
|
+
get dataSource(): JaqlDataSource;
|
|
24
|
+
constructor(name: string, type: string, desc?: string, dataSource?: JaqlDataSource);
|
|
16
25
|
/**
|
|
17
26
|
* gets the element's description
|
|
18
27
|
*/
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* @internal
|
|
3
3
|
*/
|
|
4
4
|
export class DimensionalElement {
|
|
5
|
-
constructor(name, type, desc) {
|
|
5
|
+
constructor(name, type, desc, dataSource) {
|
|
6
6
|
this._name = name;
|
|
7
7
|
this.type = type;
|
|
8
8
|
this.description = desc || '';
|
|
9
|
+
if (dataSource) {
|
|
10
|
+
this._dataSource = dataSource;
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
11
14
|
* Defines the element's name
|
|
@@ -16,6 +19,12 @@ export class DimensionalElement {
|
|
|
16
19
|
set name(value) {
|
|
17
20
|
this._name = value;
|
|
18
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Defines the element's data source
|
|
24
|
+
*/
|
|
25
|
+
get dataSource() {
|
|
26
|
+
return this._dataSource;
|
|
27
|
+
}
|
|
19
28
|
/**
|
|
20
29
|
* Gets a serializable representation of the element
|
|
21
30
|
*/
|
|
@@ -24,6 +33,7 @@ export class DimensionalElement {
|
|
|
24
33
|
name: this.name,
|
|
25
34
|
type: this.type,
|
|
26
35
|
desc: this.description,
|
|
36
|
+
dataSource: this.dataSource,
|
|
27
37
|
__serializable: 'DimensionalElement',
|
|
28
38
|
};
|
|
29
39
|
}
|
|
@@ -160,6 +160,10 @@ class AbstractFilter extends DimensionalElement {
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
result.jaql.filter = this.filterJaql();
|
|
163
|
+
// prioritize attribute dataSource for the use case of multi-source dashboard
|
|
164
|
+
if (this.attribute.dataSource) {
|
|
165
|
+
result.jaql.datasource = this.attribute.dataSource;
|
|
166
|
+
}
|
|
163
167
|
if (this.isScope) {
|
|
164
168
|
result.panel = 'scope';
|
|
165
169
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Attribute, BaseMeasure, LevelAttribute } from '../../interfaces.js';
|
|
1
|
+
import { Attribute, BaseMeasure, CalculatedMeasure, LevelAttribute } from '../../interfaces.js';
|
|
2
2
|
import { FilterJaql } from '../../types.js';
|
|
3
|
-
import { FilterJaqlInternal, RankingFilterJaql } from './types.js';
|
|
3
|
+
import { CustomFormulaJaql, FilterJaqlInternal, JaqlDataSource, RankingFilterJaql } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates an attribute or level attribute from the provided parameters
|
|
6
6
|
*
|
|
@@ -10,9 +10,10 @@ import { FilterJaqlInternal, RankingFilterJaql } from './types.js';
|
|
|
10
10
|
* @param level - Date level
|
|
11
11
|
* @param dataType - Data type
|
|
12
12
|
* @param title - Attribute title
|
|
13
|
+
* @param dataSource - Jaql data source
|
|
13
14
|
* @returns attribute or level attribute
|
|
14
15
|
*/
|
|
15
|
-
export declare const createAttributeHelper: (dim: string, table: string | undefined, column: string, level: string | undefined, dataType: string, title?: string) => Attribute | LevelAttribute;
|
|
16
|
+
export declare const createAttributeHelper: (dim: string, table: string | undefined, column: string, level: string | undefined, dataType: string, title?: string, dataSource?: JaqlDataSource) => Attribute | LevelAttribute;
|
|
16
17
|
/**
|
|
17
18
|
* Creates an attribute or level attribute from the provided filter JAQL object
|
|
18
19
|
*
|
|
@@ -29,9 +30,18 @@ export declare const createAttributeFromFilterJaql: (jaql: FilterJaql | FilterJa
|
|
|
29
30
|
* @param level - Date level
|
|
30
31
|
* @param dataType - Data type
|
|
31
32
|
* @param agg - Aggregation function
|
|
33
|
+
* @param title - Measure title
|
|
34
|
+
* @param dataSource - data source provided in JAQL
|
|
32
35
|
* @returns measure
|
|
33
36
|
*/
|
|
34
|
-
export declare const createMeasureHelper: (dim: string, table: string | undefined, column: string, level: string | undefined, dataType: string, agg: string, title?: string) => BaseMeasure;
|
|
37
|
+
export declare const createMeasureHelper: (dim: string, table: string | undefined, column: string, level: string | undefined, dataType: string, agg: string, title?: string, dataSource?: JaqlDataSource) => BaseMeasure;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a calculated measure from the provided filter JAQL object
|
|
40
|
+
*
|
|
41
|
+
* @param jaql - custom formula jaql
|
|
42
|
+
* @returns calculated measure
|
|
43
|
+
*/
|
|
44
|
+
export declare const createCalculatedMeasureFromJaql: (jaql: CustomFormulaJaql) => CalculatedMeasure;
|
|
35
45
|
/**
|
|
36
46
|
* Creates a measure from the provided filter JAQL object
|
|
37
47
|
*
|
|
@@ -45,4 +55,4 @@ export declare const createMeasureFromFilterJaql: (jaql: FilterJaqlInternal) =>
|
|
|
45
55
|
* @param jaql - Ranking filter Jaql object
|
|
46
56
|
* @returns Measure
|
|
47
57
|
*/
|
|
48
|
-
export declare const createMeasureFromRankingFilterJaql: (jaql: RankingFilterJaql) => BaseMeasure;
|
|
58
|
+
export declare const createMeasureFromRankingFilterJaql: (jaql: RankingFilterJaql | CustomFormulaJaql) => BaseMeasure | CalculatedMeasure;
|
|
@@ -2,6 +2,7 @@ import { DimensionalAttribute, DimensionalLevelAttribute, normalizeAttributeName
|
|
|
2
2
|
import { isNumber } from '../../simple-column-types.js';
|
|
3
3
|
import { MetadataTypes } from '../../types.js';
|
|
4
4
|
import * as measureFactory from '../../measures/factory.js';
|
|
5
|
+
import { transformCustomFormulaJaql } from '../../measures/factory.js';
|
|
5
6
|
const DATA_MODEL_MODULE_NAME = 'DM';
|
|
6
7
|
/**
|
|
7
8
|
* Creates an attribute or level attribute from the provided parameters
|
|
@@ -12,22 +13,23 @@ const DATA_MODEL_MODULE_NAME = 'DM';
|
|
|
12
13
|
* @param level - Date level
|
|
13
14
|
* @param dataType - Data type
|
|
14
15
|
* @param title - Attribute title
|
|
16
|
+
* @param dataSource - Jaql data source
|
|
15
17
|
* @returns attribute or level attribute
|
|
16
18
|
*/
|
|
17
|
-
export const createAttributeHelper = (dim, table, column, level, dataType, title) => {
|
|
19
|
+
export const createAttributeHelper = (dim, table, column, level, dataType, title, dataSource) => {
|
|
18
20
|
// if table is undefined, extract it from dim
|
|
19
21
|
const dimTable = table !== null && table !== void 0 ? table : dim.slice(1, -1).split('.')[0];
|
|
20
22
|
if (level) {
|
|
21
23
|
const dateLevel = DimensionalLevelAttribute.translateJaqlToGranularity({ level });
|
|
22
24
|
const format = DimensionalLevelAttribute.getDefaultFormatForGranularity(dateLevel);
|
|
23
|
-
const levelAttribute = new DimensionalLevelAttribute(title !== null && title !== void 0 ? title : column, dim, dateLevel, format);
|
|
25
|
+
const levelAttribute = new DimensionalLevelAttribute(title !== null && title !== void 0 ? title : column, dim, dateLevel, format, undefined, undefined, dataSource);
|
|
24
26
|
levelAttribute.composeCode = normalizeAttributeName(dimTable, column, level, DATA_MODEL_MODULE_NAME);
|
|
25
27
|
return levelAttribute;
|
|
26
28
|
}
|
|
27
29
|
const attributeType = isNumber(dataType)
|
|
28
30
|
? MetadataTypes.NumericAttribute
|
|
29
31
|
: MetadataTypes.TextAttribute;
|
|
30
|
-
const attribute = new DimensionalAttribute(title !== null && title !== void 0 ? title : column, dim, attributeType);
|
|
32
|
+
const attribute = new DimensionalAttribute(title !== null && title !== void 0 ? title : column, dim, attributeType, undefined, undefined, dataSource);
|
|
31
33
|
attribute.composeCode = normalizeAttributeName(dimTable, column, undefined, DATA_MODEL_MODULE_NAME);
|
|
32
34
|
return attribute;
|
|
33
35
|
};
|
|
@@ -38,7 +40,8 @@ export const createAttributeHelper = (dim, table, column, level, dataType, title
|
|
|
38
40
|
* @returns attribute or level attribute
|
|
39
41
|
*/
|
|
40
42
|
export const createAttributeFromFilterJaql = (jaql) => {
|
|
41
|
-
|
|
43
|
+
const { dim, table, column, level, datatype, title, datasource: dataSource } = jaql;
|
|
44
|
+
return createAttributeHelper(dim, table, column, level, datatype, title, dataSource);
|
|
42
45
|
};
|
|
43
46
|
/**
|
|
44
47
|
* Creates a measure from the provided parameters
|
|
@@ -49,14 +52,29 @@ export const createAttributeFromFilterJaql = (jaql) => {
|
|
|
49
52
|
* @param level - Date level
|
|
50
53
|
* @param dataType - Data type
|
|
51
54
|
* @param agg - Aggregation function
|
|
55
|
+
* @param title - Measure title
|
|
56
|
+
* @param dataSource - data source provided in JAQL
|
|
52
57
|
* @returns measure
|
|
53
58
|
*/
|
|
54
|
-
export const createMeasureHelper = (dim, table, column, level, dataType, agg, title) => {
|
|
55
|
-
const attribute = createAttributeHelper(dim, table, column, level, dataType, title);
|
|
59
|
+
export const createMeasureHelper = (dim, table, column, level, dataType, agg, title, dataSource) => {
|
|
60
|
+
const attribute = createAttributeHelper(dim, table, column, level, dataType, title, dataSource);
|
|
56
61
|
const measure = measureFactory.aggregate(attribute, agg);
|
|
57
62
|
measure.composeCode = `measureFactory.${agg}(${attribute.composeCode})`;
|
|
58
63
|
return measure;
|
|
59
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Creates a calculated measure from the provided filter JAQL object
|
|
67
|
+
*
|
|
68
|
+
* @param jaql - custom formula jaql
|
|
69
|
+
* @returns calculated measure
|
|
70
|
+
*/
|
|
71
|
+
export const createCalculatedMeasureFromJaql = (jaql) => {
|
|
72
|
+
const measure = transformCustomFormulaJaql(jaql);
|
|
73
|
+
// TBD (SNS-108945)
|
|
74
|
+
// Handle preparation of 'composeCode' for formula
|
|
75
|
+
measure.composeCode = `'Formula code to be implemented'`;
|
|
76
|
+
return measure;
|
|
77
|
+
};
|
|
60
78
|
/**
|
|
61
79
|
* Creates a measure from the provided filter JAQL object
|
|
62
80
|
*
|
|
@@ -64,10 +82,10 @@ export const createMeasureHelper = (dim, table, column, level, dataType, agg, ti
|
|
|
64
82
|
* @returns Measure
|
|
65
83
|
*/
|
|
66
84
|
export const createMeasureFromFilterJaql = (jaql) => {
|
|
67
|
-
const { dim, table, column, title, level, datatype: dataType, agg } = jaql;
|
|
85
|
+
const { dim, table, column, title, level, datatype: dataType, agg, datasource: dataSource, } = jaql;
|
|
68
86
|
if (!agg)
|
|
69
87
|
return undefined;
|
|
70
|
-
return createMeasureHelper(dim, table, column, level, dataType, agg, title);
|
|
88
|
+
return createMeasureHelper(dim, table, column, level, dataType, agg, title, dataSource);
|
|
71
89
|
};
|
|
72
90
|
/**
|
|
73
91
|
* Creates a measure from the provided ranking filter JAQL object
|
|
@@ -76,6 +94,8 @@ export const createMeasureFromFilterJaql = (jaql) => {
|
|
|
76
94
|
* @returns Measure
|
|
77
95
|
*/
|
|
78
96
|
export const createMeasureFromRankingFilterJaql = (jaql) => {
|
|
97
|
+
if ('formula' in jaql)
|
|
98
|
+
return createCalculatedMeasureFromJaql(jaql);
|
|
79
99
|
const { dim, table, column, level, datatype: dataType, agg } = jaql;
|
|
80
100
|
return createMeasureHelper(dim, table, column, level, dataType, agg);
|
|
81
101
|
};
|
|
@@ -85,12 +85,14 @@ export const createAttributeFilterFromConditionFilterJaql = (attribute, conditio
|
|
|
85
85
|
const conditionType = getSelectedConditionOption(conditionFilterJaql);
|
|
86
86
|
switch (conditionType) {
|
|
87
87
|
case ConditionFilterType.BOTTOM:
|
|
88
|
-
if (conditionFilterJaql.by
|
|
88
|
+
if (conditionFilterJaql.by) {
|
|
89
89
|
return withComposeCode(filterFactory.bottomRanking)(attribute, createMeasureFromRankingFilterJaql(conditionFilterJaql.by), conditionFilterJaql[ConditionFilterType.BOTTOM], guid);
|
|
90
90
|
}
|
|
91
91
|
break;
|
|
92
92
|
case ConditionFilterType.EQUALS:
|
|
93
93
|
return withComposeCode(filterFactory.equals)(attribute, conditionFilterJaql[ConditionFilterType.EQUALS], guid);
|
|
94
|
+
case ConditionFilterType.DOESNT_EQUAL:
|
|
95
|
+
return withComposeCode(filterFactory.doesntEqual)(attribute, conditionFilterJaql[ConditionFilterType.DOESNT_EQUAL], guid);
|
|
94
96
|
case ConditionFilterType.GREATER_THAN:
|
|
95
97
|
return withComposeCode(filterFactory.greaterThan)(attribute, conditionFilterJaql[ConditionFilterType.GREATER_THAN], guid);
|
|
96
98
|
case ConditionFilterType.GREATER_THAN_OR_EQUAL:
|
|
@@ -177,7 +177,7 @@ export const createFilterFromJaqlInternal = (jaql, guid) => {
|
|
|
177
177
|
}
|
|
178
178
|
catch (e) {
|
|
179
179
|
// if a filter type is untranslatable, fall back to the generic pass-through JAQL filter
|
|
180
|
-
|
|
180
|
+
console.debug('Fall back to generic pass-through JAQL filter due to filter translation error:', e);
|
|
181
181
|
}
|
|
182
182
|
return createGenericFilter(jaql, guid);
|
|
183
183
|
};
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { FormulaContext, FormulaJaql } from '../../types.js';
|
|
1
2
|
declare type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
2
3
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
|
|
3
4
|
}[Keys];
|
|
4
5
|
export declare type JaqlContext = Record<string, Partial<FilterJaqlInternal>>;
|
|
5
6
|
export declare type Id = string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Data source as specified in the jaql
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare type JaqlDataSource = {
|
|
13
|
+
address?: Id;
|
|
14
|
+
database?: string;
|
|
15
|
+
id?: string;
|
|
10
16
|
title: string;
|
|
11
17
|
live?: boolean;
|
|
12
|
-
fullname
|
|
18
|
+
fullname?: string;
|
|
13
19
|
lastBuildTime?: string;
|
|
14
20
|
revisionId?: string;
|
|
15
21
|
};
|
|
@@ -56,6 +62,9 @@ export interface RangeFilterJaql extends BaseFilterJaql {
|
|
|
56
62
|
to?: string | number;
|
|
57
63
|
multiSelection?: boolean;
|
|
58
64
|
}
|
|
65
|
+
export declare type CustomFormulaJaql = (FormulaJaql & {
|
|
66
|
+
context?: FormulaJaql | FormulaContext;
|
|
67
|
+
}) | FormulaContext;
|
|
59
68
|
export declare type RankingFilterJaql = {
|
|
60
69
|
agg: string;
|
|
61
70
|
column: string;
|
|
@@ -120,7 +129,7 @@ export declare enum DatetimeLevel {
|
|
|
120
129
|
export declare type FilterJaqlInternal = {
|
|
121
130
|
title: string;
|
|
122
131
|
column: string;
|
|
123
|
-
datasource?:
|
|
132
|
+
datasource?: JaqlDataSource;
|
|
124
133
|
datatype: string;
|
|
125
134
|
dim: string;
|
|
126
135
|
dimension?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataSource } from '../interfaces.js';
|
|
2
|
-
import { Sort } from './types.js';
|
|
2
|
+
import { JaqlDataSource, Sort } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -35,6 +35,12 @@ export interface Element {
|
|
|
35
35
|
* @internal
|
|
36
36
|
*/
|
|
37
37
|
readonly id: string;
|
|
38
|
+
/**
|
|
39
|
+
* Data Source
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
readonly dataSource?: JaqlDataSource;
|
|
38
44
|
/**
|
|
39
45
|
* Gets a serializable representation of the element.
|
|
40
46
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Attribute, Measure, Filter, CalculatedMeasure, BaseMeasure, CustomFormulaContext } from '../interfaces.js';
|
|
2
2
|
import { ForecastFormulaOptions, TrendFormulaOptions } from '../../interfaces.js';
|
|
3
|
+
import { CustomFormulaJaql } from '../filters/utils/types.js';
|
|
3
4
|
/**
|
|
4
5
|
* Defines the different numeric operators that can be used with numeric filters
|
|
5
6
|
*
|
|
@@ -32,6 +33,16 @@ export declare const RankingSortTypes: {
|
|
|
32
33
|
Ascending: string;
|
|
33
34
|
Descending: string;
|
|
34
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Transforms a custom formula jaql into a calculated measure instance.
|
|
38
|
+
*
|
|
39
|
+
* As custom formulas can be nested, the function performs a recursive transformation via a helper function.
|
|
40
|
+
*
|
|
41
|
+
* @param jaql - Custom formula jaql
|
|
42
|
+
* @returns Calculated measure instance
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function transformCustomFormulaJaql(jaql: CustomFormulaJaql): CalculatedMeasure;
|
|
35
46
|
/**
|
|
36
47
|
* Creates a calculated measure for a valid custom formula built from [base functions](/guides/sdk/reference/functions.html#measured-value-functions).
|
|
37
48
|
*
|
|
@@ -78,7 +89,6 @@ export declare const RankingSortTypes: {
|
|
|
78
89
|
* },
|
|
79
90
|
* );
|
|
80
91
|
* ```
|
|
81
|
-
*
|
|
82
92
|
* @param title - Title of the measure to be displayed in legend
|
|
83
93
|
* @param formula - Formula to be used for the measure
|
|
84
94
|
* @param context - Formula context as a map of strings to attributes, measures, or filters
|
|
@@ -103,8 +103,9 @@ function transformFormulaJaqlHelper(jaql) {
|
|
|
103
103
|
*
|
|
104
104
|
* @param jaql - Custom formula jaql
|
|
105
105
|
* @returns Calculated measure instance
|
|
106
|
+
* @internal
|
|
106
107
|
*/
|
|
107
|
-
function transformCustomFormulaJaql(jaql) {
|
|
108
|
+
export function transformCustomFormulaJaql(jaql) {
|
|
108
109
|
var _a;
|
|
109
110
|
const isFormulaJaql = 'formula' in jaql;
|
|
110
111
|
if (!isFormulaJaql) {
|
|
@@ -160,7 +161,6 @@ function transformCustomFormulaJaql(jaql) {
|
|
|
160
161
|
* },
|
|
161
162
|
* );
|
|
162
163
|
* ```
|
|
163
|
-
*
|
|
164
164
|
* @param title - Title of the measure to be displayed in legend
|
|
165
165
|
* @param formula - Formula to be used for the measure
|
|
166
166
|
* @param context - Formula context as a map of strings to attributes, measures, or filters
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { type ConditionFilterJaql } from './filters/utils/types.js';
|
|
1
|
+
import { JaqlDataSource, type ConditionFilterJaql } from './filters/utils/types.js';
|
|
2
|
+
import { Attribute } from './interfaces.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type { JaqlDataSource };
|
|
2
7
|
/**
|
|
3
8
|
* Different aggregation types
|
|
4
9
|
*/
|
|
@@ -123,7 +128,7 @@ export declare const MetadataTypes: {
|
|
|
123
128
|
* @param o - object to check
|
|
124
129
|
* @returns true if the object or type is an attribute - of any type
|
|
125
130
|
*/
|
|
126
|
-
isAttribute(o: any):
|
|
131
|
+
isAttribute(o: any): o is Attribute;
|
|
127
132
|
/**
|
|
128
133
|
* Checks whether the given object or type is a filter
|
|
129
134
|
*
|
|
@@ -182,6 +187,7 @@ export declare type BaseJaql = {
|
|
|
182
187
|
dim: string;
|
|
183
188
|
table: string;
|
|
184
189
|
column: string;
|
|
190
|
+
datasource?: JaqlDataSource;
|
|
185
191
|
title: string;
|
|
186
192
|
level?: 'years' | 'quarters' | 'months' | 'weeks' | 'minutes' | 'days';
|
|
187
193
|
sort?: `${JaqlSortDirection}`;
|
|
@@ -260,4 +266,3 @@ export declare type OrFilter<FilterItem> = {
|
|
|
260
266
|
* Abstract object with any unknown values
|
|
261
267
|
*/
|
|
262
268
|
export declare type AnyObject = Record<string, any>;
|
|
263
|
-
export {};
|