@gooddata/typings
Advanced tools
Comparing version 2.26.1 to 2.27.0-alpha-bertold8-ine-one-4906-2021-03-02T15-47-41-957Z
@@ -87,3 +87,3 @@ /** | ||
} | ||
type ExtendedFilter = FilterItem | IMeasureValueFilter; | ||
type ExtendedFilter = FilterItem | IMeasureValueFilter | IRankingFilter; | ||
type CompatibilityFilter = IExpressionFilter | ExtendedFilter; | ||
@@ -150,2 +150,11 @@ type FilterItem = DateFilterItem | AttributeFilterItem; | ||
} | ||
type RankingFilterOperator = 'TOP' | 'BOTTOM'; | ||
interface IRankingFilter { | ||
rankingFilter: { | ||
measures: Qualifier[]; | ||
attributes?: Qualifier[]; | ||
operator: RankingFilterOperator; | ||
value: number; | ||
}; | ||
} | ||
interface IExpressionFilter { | ||
@@ -224,3 +233,4 @@ value: string; | ||
function isMeasureValueFilter(filter: AFM.CompatibilityFilter): filter is AFM.IMeasureValueFilter; | ||
function isRankingFilter(filter: AFM.CompatibilityFilter): filter is AFM.IRankingFilter; | ||
function isExpressionFilter(filter: AFM.CompatibilityFilter): filter is AFM.IExpressionFilter; | ||
} |
@@ -85,2 +85,6 @@ "use strict"; | ||
AFM.isMeasureValueFilter = isMeasureValueFilter; | ||
function isRankingFilter(filter) { | ||
return !isEmpty(filter) && filter.rankingFilter !== undefined; | ||
} | ||
AFM.isRankingFilter = isRankingFilter; | ||
function isExpressionFilter(filter) { | ||
@@ -87,0 +91,0 @@ return !isEmpty(filter) && filter.value !== undefined; |
@@ -36,2 +36,3 @@ import { VisualizationObject } from './VisualizationObject'; | ||
width: number; | ||
height?: number; | ||
heightAsRatio?: number; | ||
@@ -38,0 +39,0 @@ } |
@@ -82,3 +82,3 @@ /** | ||
} | ||
type ExtendedFilter = FilterItem | IMeasureValueFilter; | ||
type ExtendedFilter = FilterItem | IMeasureValueFilter | IRankingFilter; | ||
type CompatibilityFilter = IExpressionFilter | ExtendedFilter; | ||
@@ -150,2 +150,11 @@ type FilterItem = DateFilterItem | AttributeFilterItem; | ||
} | ||
type RankingFilterOperator = 'TOP' | 'BOTTOM'; | ||
interface IRankingFilter { | ||
rankingFilter: { | ||
measures: Qualifier[]; | ||
attributes?: Qualifier[]; | ||
operator: RankingFilterOperator; | ||
value: number; | ||
}; | ||
} | ||
interface IExpressionFilter { | ||
@@ -224,2 +233,3 @@ value: string; | ||
function isMeasureValueFilter(filter: ExecuteAFM.CompatibilityFilter): filter is ExecuteAFM.IMeasureValueFilter; | ||
function isRankingFilter(filter: ExecuteAFM.CompatibilityFilter): filter is ExecuteAFM.IRankingFilter; | ||
function isExpressionFilter(filter: ExecuteAFM.CompatibilityFilter): filter is ExecuteAFM.IExpressionFilter; | ||
@@ -226,0 +236,0 @@ function isAttributeElementsArray(attributeElements: AttributeElements): attributeElements is string[]; |
@@ -86,2 +86,7 @@ "use strict"; | ||
ExecuteAFM.isMeasureValueFilter = isMeasureValueFilter; | ||
function isRankingFilter(filter) { | ||
return !isEmpty(filter) | ||
&& filter.rankingFilter !== undefined; | ||
} | ||
ExecuteAFM.isRankingFilter = isRankingFilter; | ||
function isExpressionFilter(filter) { | ||
@@ -88,0 +93,0 @@ return !isEmpty(filter) && filter.value !== undefined; |
"use strict"; | ||
exports.__esModule = true; | ||
// (C) 2007-2019 GoodData Corporation | ||
// (C) 2007-2020 GoodData Corporation | ||
var AFM_1 = require("../AFM"); | ||
@@ -428,2 +428,11 @@ describe('AFM', function () { | ||
}; | ||
var rankingFilter = { | ||
rankingFilter: { | ||
measures: [{ | ||
uri: '/gdc/mock/date' | ||
}], | ||
operator: 'TOP', | ||
value: 3 | ||
} | ||
}; | ||
describe('isDateFilter', function () { | ||
@@ -458,2 +467,6 @@ it('should return false when null is tested', function () { | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isDateFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -493,2 +506,6 @@ var result = AFM_1.AFM.isDateFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isRelativeDateFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -528,2 +545,6 @@ var result = AFM_1.AFM.isRelativeDateFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isAbsoluteDateFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -563,2 +584,6 @@ var result = AFM_1.AFM.isAbsoluteDateFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isAttributeFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -598,2 +623,6 @@ var result = AFM_1.AFM.isAttributeFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isPositiveAttributeFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -633,2 +662,6 @@ var result = AFM_1.AFM.isPositiveAttributeFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isNegativeAttributeFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -668,2 +701,6 @@ var result = AFM_1.AFM.isNegativeAttributeFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isMeasureValueFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -674,2 +711,40 @@ var result = AFM_1.AFM.isMeasureValueFilter(expressionFilter); | ||
}); | ||
describe('isRankingFilter', function () { | ||
it('should return false when null is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(null); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when undefined is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(undefined); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when relative date filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(relativeDateFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when absolute date filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(absoluteDateFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when negative attribute filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(negativeAttributeFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when positive attribute filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(positiveAttributeFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when measure value filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(measureValueFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(rankingFilter); | ||
expect(result).toEqual(true); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
var result = AFM_1.AFM.isRankingFilter(expressionFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
}); | ||
describe('isExpressionFilter', function () { | ||
@@ -704,2 +779,6 @@ it('should return false when null is tested', function () { | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = AFM_1.AFM.isExpressionFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -706,0 +785,0 @@ var result = AFM_1.AFM.isExpressionFilter(expressionFilter); |
"use strict"; | ||
exports.__esModule = true; | ||
// (C) 2019 GoodData Corporation | ||
// (C) 2019-2020 GoodData Corporation | ||
var ExecuteAFM_1 = require("../ExecuteAFM"); | ||
@@ -51,2 +51,11 @@ describe('AFM', function () { | ||
}; | ||
var rankingFilter = { | ||
rankingFilter: { | ||
measures: [{ | ||
uri: '/gdc/mock/date' | ||
}], | ||
operator: 'TOP', | ||
value: 3 | ||
} | ||
}; | ||
describe('isDateFilter', function () { | ||
@@ -81,2 +90,6 @@ it('should return false when null is tested', function () { | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isDateFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -116,2 +129,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isDateFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRelativeDateFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -151,2 +168,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isRelativeDateFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isAbsoluteDateFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -186,2 +207,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isAbsoluteDateFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isAttributeFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -221,2 +246,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isAttributeFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isPositiveAttributeFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -256,2 +285,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isPositiveAttributeFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isNegativeAttributeFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -291,2 +324,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isNegativeAttributeFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isMeasureValueFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -326,2 +363,6 @@ var result = ExecuteAFM_1.ExecuteAFM.isMeasureValueFilter(expressionFilter); | ||
}); | ||
it('should return false when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isExpressionFilter(rankingFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
@@ -332,2 +373,40 @@ var result = ExecuteAFM_1.ExecuteAFM.isExpressionFilter(expressionFilter); | ||
}); | ||
describe('isRankingFilter', function () { | ||
it('should return false when null is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(null); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when undefined is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(undefined); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when relative date filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(relativeDateFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when absolute date filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(absoluteDateFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when negative attribute filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(negativeAttributeFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when positive attribute filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(positiveAttributeFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when measure value filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(measureValueFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when ranking filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(rankingFilter); | ||
expect(result).toEqual(true); | ||
}); | ||
it('should return false when expression filter is tested', function () { | ||
var result = ExecuteAFM_1.ExecuteAFM.isRankingFilter(expressionFilter); | ||
expect(result).toEqual(false); | ||
}); | ||
}); | ||
describe('isAttributeElementsArray', function () { | ||
@@ -334,0 +413,0 @@ it('should return false when null is tested', function () { |
"use strict"; | ||
exports.__esModule = true; | ||
// (C) 2019 GoodData Corporation | ||
// (C) 2019-2020 GoodData Corporation | ||
var VisualizationInput_1 = require("../VisualizationInput"); | ||
@@ -455,3 +455,38 @@ describe('VisualizationObject', function () { | ||
}); | ||
describe('isRankingFilter', function () { | ||
it('should return false when null is tested', function () { | ||
var result = VisualizationInput_1.VisualizationInput.isRankingFilter(null); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when undefined is tested', function () { | ||
var result = VisualizationInput_1.VisualizationInput.isRankingFilter(undefined); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when measure value filter is tested', function () { | ||
var filter = { | ||
rankingFilter: { | ||
measures: [{ | ||
uri: '/gdc/mock/date' | ||
}], | ||
operator: 'TOP', | ||
value: 3 | ||
} | ||
}; | ||
var result = VisualizationInput_1.VisualizationInput.isRankingFilter(filter); | ||
expect(result).toEqual(true); | ||
}); | ||
it('should return false when positive attribute filter is tested', function () { | ||
var filter = { | ||
positiveAttributeFilter: { | ||
displayForm: { | ||
uri: '/gdc/mock/attribute' | ||
}, | ||
"in": ['/gdc/mock/attribute/value_1', '/gdc/mock/attribute/value_2'] | ||
} | ||
}; | ||
var result = VisualizationInput_1.VisualizationInput.isRankingFilter(filter); | ||
expect(result).toEqual(false); | ||
}); | ||
}); | ||
}); | ||
//# sourceMappingURL=VisualizationInputs.test.js.map |
@@ -573,2 +573,37 @@ "use strict"; | ||
}); | ||
describe('isRankingFilter', function () { | ||
it('should return false when null is tested', function () { | ||
var result = VisualizationObject_1.VisualizationObject.isRankingFilter(null); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return false when undefined is tested', function () { | ||
var result = VisualizationObject_1.VisualizationObject.isRankingFilter(undefined); | ||
expect(result).toEqual(false); | ||
}); | ||
it('should return true when measure value filter is tested', function () { | ||
var filter = { | ||
rankingFilter: { | ||
measures: [{ | ||
uri: '/gdc/mock/date' | ||
}], | ||
operator: 'TOP', | ||
value: 3 | ||
} | ||
}; | ||
var result = VisualizationObject_1.VisualizationObject.isRankingFilter(filter); | ||
expect(result).toEqual(true); | ||
}); | ||
it('should return false when positive attribute filter is tested', function () { | ||
var filter = { | ||
positiveAttributeFilter: { | ||
displayForm: { | ||
uri: '/gdc/mock/attribute' | ||
}, | ||
"in": ['/gdc/mock/attribute/value_1', '/gdc/mock/attribute/value_2'] | ||
} | ||
}; | ||
var result = VisualizationObject_1.VisualizationObject.isRankingFilter(filter); | ||
expect(result).toEqual(false); | ||
}); | ||
}); | ||
describe('isLocalIdentifierQualifier', function () { | ||
@@ -575,0 +610,0 @@ it('should return false when null is tested', function () { |
@@ -44,4 +44,5 @@ import { AFM } from './AFM'; | ||
type IMeasureValueFilter = VisualizationObject.IMeasureValueFilter; | ||
type IRankingFilter = VisualizationObject.IRankingFilter; | ||
type IMeasureFilter = IAbsoluteDateFilter | IRelativeDateFilter | IPositiveAttributeFilter | INegativeAttributeFilter; | ||
type IFilter = IAbsoluteDateFilter | IRelativeDateFilter | IPositiveAttributeFilter | INegativeAttributeFilter | IMeasureValueFilter; | ||
type IFilter = IAbsoluteDateFilter | IRelativeDateFilter | IPositiveAttributeFilter | INegativeAttributeFilter | IMeasureValueFilter | IRankingFilter; | ||
type ISort = AFM.IAttributeSortItem | AFM.IMeasureSortItem; | ||
@@ -60,3 +61,4 @@ type ITotal = VisualizationObject.IVisualizationTotal; | ||
function isMeasureValueFilter(obj: any): obj is IMeasureValueFilter; | ||
function isRankingFilter(obj: any): obj is IRankingFilter; | ||
function isSort(obj: any): obj is ISort; | ||
} |
"use strict"; | ||
exports.__esModule = true; | ||
// (C) 2019 GoodData Corporation | ||
// (C) 2019-2020 GoodData Corporation | ||
var AFM_1 = require("./AFM"); | ||
@@ -60,2 +60,6 @@ var VisualizationObject_1 = require("./VisualizationObject"); | ||
VisualizationInput.isMeasureValueFilter = isMeasureValueFilter; | ||
function isRankingFilter(obj) { | ||
return VisualizationObject_1.VisualizationObject.isRankingFilter(obj); | ||
} | ||
VisualizationInput.isRankingFilter = isRankingFilter; | ||
function isSort(obj) { | ||
@@ -62,0 +66,0 @@ return AFM_1.AFM.isAttributeSortItem(obj) || AFM_1.AFM.isMeasureSortItem(obj); |
@@ -10,3 +10,3 @@ import { IObjectMeta } from './Meta'; | ||
type BucketItem = IMeasure | IVisualizationAttribute; | ||
type VisualizationObjectExtendedFilter = VisualizationObjectFilter | IMeasureValueFilter; | ||
type VisualizationObjectExtendedFilter = VisualizationObjectFilter | IMeasureValueFilter | IRankingFilter; | ||
type VisualizationObjectFilter = VisualizationObjectDateFilter | VisualizationObjectAttributeFilter; | ||
@@ -76,2 +76,11 @@ type VisualizationObjectDateFilter = IVisualizationObjectRelativeDateFilter | IVisualizationObjectAbsoluteDateFilter; | ||
} | ||
type RankingFilterOperator = 'TOP' | 'BOTTOM'; | ||
interface IRankingFilter { | ||
rankingFilter: { | ||
measures: Array<IObjUriQualifier | ILocalIdentifierQualifier>; | ||
attributes?: Array<IObjUriQualifier | ILocalIdentifierQualifier>; | ||
operator: RankingFilterOperator; | ||
value: number; | ||
}; | ||
} | ||
interface IVisualizationObjectContent { | ||
@@ -165,2 +174,3 @@ visualizationClass: IObjUriQualifier; | ||
function isMeasureValueFilter(filter: VisualizationObjectExtendedFilter): filter is IMeasureValueFilter; | ||
function isRankingFilter(filter: VisualizationObjectExtendedFilter): filter is IRankingFilter; | ||
function isAbsoluteDateFilter(filter: VisualizationObjectDateFilter): filter is IVisualizationObjectAbsoluteDateFilter; | ||
@@ -167,0 +177,0 @@ function isRelativeDateFilter(filter: VisualizationObjectDateFilter): filter is IVisualizationObjectRelativeDateFilter; |
@@ -51,2 +51,7 @@ "use strict"; | ||
VisualizationObject.isMeasureValueFilter = isMeasureValueFilter; | ||
function isRankingFilter(filter) { | ||
return !isEmpty(filter) | ||
&& filter.rankingFilter !== undefined; | ||
} | ||
VisualizationObject.isRankingFilter = isRankingFilter; | ||
function isAbsoluteDateFilter(filter) { | ||
@@ -53,0 +58,0 @@ return !isEmpty(filter) && filter.absoluteDateFilter !== undefined; |
{ | ||
"name": "@gooddata/typings", | ||
"version": "2.26.1", | ||
"version": "2.27.0-alpha-bertold8-ine-one-4906-2021-03-02T15-47-41-957Z", | ||
"description": "TypeScript definition files for GoodData platform", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
379190
6439
1