import { type DateFilterGranularity, type DateString } from "../dateFilterConfig/index.js"; import { type EmptyValues, type IAttributeElements, type ILowerBoundedFilter, type IUpperBoundedFilter, type MatchFilterOperator, type MeasureValueFilterCondition } from "../execution/filter/index.js"; import { type ObjRef } from "../objRef/index.js"; import { type IDashboardObjectIdentity } from "./common.js"; /** * Date filter type - relative * @beta */ export type DateFilterRelativeType = "relative"; /** * Date filter type - absolute * @beta */ export type DateFilterAbsoluteType = "absolute"; /** * Date filter type - relative or absolute * @beta */ export type DateFilterType = DateFilterRelativeType | DateFilterAbsoluteType; /** * Parent filter of an attribute filter of the filter context * @beta */ export interface IDashboardAttributeFilterParent { /** * Local identifier of the parent filter */ filterLocalIdentifier: string; /** * Specification of the connection point(s) between the parent and child filter in the data model */ over: { attributes: ObjRef[]; }; } /** * Dependent date filter of an attribute filter of the filter context * @beta */ export interface IDashboardAttributeFilterByDate { /** * Local identifier of the date filter */ filterLocalIdentifier: string; /** * To distinguish between different types of date filters (common, specific) */ isCommonDate: boolean; } /** * Attribute filter selection mode value * @beta */ export type DashboardAttributeFilterSelectionMode = "single" | "multi"; /** * Attribute filter of the filter context * @public */ export interface IDashboardAttributeFilter { attributeFilter: { /** * Display form object ref */ displayForm: ObjRef; /** * Is negative filter? */ negativeSelection: boolean; /** * Selected attribute elements * @beta */ attributeElements: IAttributeElements; /** * Identifier of the filter which is valid in the scope of the filter context */ localIdentifier?: string; /** * Parent filters that are limiting elements available in this filter * @beta */ filterElementsBy?: IDashboardAttributeFilterParent[]; /** * Date filters that are limiting attributes elements available in this filter. * @beta */ filterElementsByDate?: IDashboardAttributeFilterByDate[]; /** * Items that are limiting attribute elements available in this filter. * @alpha */ validateElementsBy?: ObjRef[]; /** * Custom title of the attribute filter. If specified has priority over the default attribute filter title. */ title?: string; /** * Selection mode which defines how many elements can be in attributeElements. * Default value is 'multi' if property is missing. * @beta */ selectionMode?: DashboardAttributeFilterSelectionMode; }; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardAttributeFilter}. * @alpha */ export declare function isDashboardAttributeFilter(obj: unknown): obj is IDashboardAttributeFilter; /** * Returns true when given filter has selection mode set to single * @alpha */ export declare function isSingleSelectionFilter(filter: IDashboardAttributeFilter): boolean; /** * Returns true when given filter has negative selection * @alpha */ export declare function isNegativeAttributeFilter(filter: IDashboardAttributeFilter): boolean; /** * Returns count of selected elements * @alpha */ export declare function getSelectedElementsCount(filter: IDashboardAttributeFilter): number; /** * Arbitrary attribute filter of the filter context. * * @remarks * Allows filtering by custom string values that don't need to exist as actual attribute elements. * Unlike {@link IDashboardAttributeFilter}, values are free-form strings, not references to existing elements. * * @alpha */ export interface IDashboardArbitraryAttributeFilter { arbitraryAttributeFilter: { /** * Display form object ref */ displayForm: ObjRef; /** * Arbitrary string values to filter by */ values: Array; /** * Is negative filter? */ negativeSelection: boolean; /** * Identifier of the filter which is valid in the scope of the filter context */ localIdentifier?: string; /** * Custom title of the filter. If specified has priority over the default filter title. */ title?: string; /** * Parent filters that are limiting autocomplete suggestions available in this filter. * @beta */ filterElementsBy?: IDashboardAttributeFilterParent[]; /** * Date filters that are limiting autocomplete suggestions available in this filter. * @beta */ filterElementsByDate?: IDashboardAttributeFilterByDate[]; /** * Items that are limiting attribute elements for autocomplete suggestions available in this filter. * @alpha */ validateElementsBy?: ObjRef[]; }; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardArbitraryAttributeFilter}. * @alpha */ export declare function isDashboardArbitraryAttributeFilter(obj: unknown): obj is IDashboardArbitraryAttributeFilter; /** * Match attribute filter of the filter context. * * @remarks * Allows filtering by pattern matching on attribute values using operators * like "contains", "startsWith", or "endsWith". * * @alpha */ export interface IDashboardMatchAttributeFilter { matchAttributeFilter: { /** * Display form object ref */ displayForm: ObjRef; /** * Match operator */ operator: MatchFilterOperator; /** * The literal string to match against attribute values */ literal: string; /** * Whether matching is case sensitive. Defaults to false. */ caseSensitive?: boolean; /** * Whether this is a negative match (NOT LIKE). Defaults to false. */ negativeSelection?: boolean; /** * Identifier of the filter which is valid in the scope of the filter context */ localIdentifier?: string; /** * Custom title of the filter. If specified has priority over the default filter title. */ title?: string; }; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardMatchAttributeFilter}. * @alpha */ export declare function isDashboardMatchAttributeFilter(obj: unknown): obj is IDashboardMatchAttributeFilter; /** * Union of text mode attribute filter types (arbitrary and match). * * @remarks * These filters use free-text values rather than element selection. * * @alpha */ export type DashboardTextAttributeFilter = IDashboardArbitraryAttributeFilter | IDashboardMatchAttributeFilter; /** * Type-guard testing whether the provided object is a text mode attribute filter * ({@link IDashboardArbitraryAttributeFilter} or {@link IDashboardMatchAttributeFilter}). * @alpha */ export declare function isDashboardTextAttributeFilter(obj: unknown): obj is DashboardTextAttributeFilter; /** * Union of all dashboard attribute-based filter types, including element selection * filters and text mode filters (arbitrary, match). * * @alpha */ export type DashboardAttributeFilterItem = IDashboardAttributeFilter | IDashboardArbitraryAttributeFilter | IDashboardMatchAttributeFilter; /** * Type-guard testing whether the provided object is an instance of {@link DashboardAttributeFilterItem}. * @alpha */ export declare function isDashboardAttributeFilterItem(obj: unknown): obj is DashboardAttributeFilterItem; /** * Date filter of the filter context * @public */ export interface IDashboardDateFilter { dateFilter: { /** * Date filter type - relative or absolute * @beta */ type: DateFilterType; /** * Date filter granularity * @beta */ granularity: DateFilterGranularity; /** * Filter - from * @beta */ from?: DateString | number; /** * Filter - to * @beta */ to?: DateString | number; /** * DateDataSet object ref */ dataSet?: ObjRef; /** * Date attribute object ref */ attribute?: ObjRef; /** * Identifier of the filter which is valid in the scope of the filter context */ localIdentifier?: string; /** * Additional bounded filter * @alpha */ boundedFilter?: IUpperBoundedFilter | ILowerBoundedFilter; /** * How to treat empty date values. * * @alpha */ emptyValueHandling?: EmptyValues; }; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardDateFilter}. * @alpha */ export declare function isDashboardDateFilter(obj: unknown): obj is IDashboardDateFilter; /** * Type-guard testing whether the provided object is an instance of {@link IDashboardDateFilter} without date dataSet (aka dimension) defined. * @alpha */ export declare function isDashboardCommonDateFilter(obj: unknown): obj is IDashboardDateFilter; /** * Type-guard testing whether the provided object is an instance of {@link IDashboardDateFilter} with date dataSet (aka dimension) defined. * @alpha */ export declare function isDashboardDateFilterWithDimension(obj: unknown): obj is IDashboardDateFilter; /** * Returns true when given date filter has type set to relative. * @alpha */ export declare function isRelativeDashboardDateFilter(dateFilter: IDashboardDateFilter): boolean; /** * Returns true when given date filter has type set to relative and bounded filter is set. * @alpha */ export declare function isRelativeBoundedDashboardDateFilter(dateFilter: IDashboardDateFilter): boolean; /** * Returns true when given date filter has type set to absolute. * @alpha */ export declare function isAbsoluteDashboardDateFilter(dateFilter: IDashboardDateFilter): boolean; /** * Creates a new relative dashboard date filter. * * @param granularity - granularity of the filters (month, year, etc.) * @param from - start of the interval – negative numbers mean the past, zero means today, positive numbers mean the future * @param to - end of the interval – negative numbers mean the past, zero means today, positive numbers mean the future * @alpha */ export declare function newRelativeDashboardDateFilter(granularity: DateFilterGranularity, from: number, to: number, dataSet?: ObjRef, localIdentifier?: string, boundedFilter?: IUpperBoundedFilter | ILowerBoundedFilter, emptyValueHandling?: EmptyValues): IDashboardDateFilter; /** * Creates a new absolute dashboard date filter. * * @param from - start of the interval in ISO-8601 calendar date format * @param to - end of the interval in ISO-8601 calendar date format * @alpha */ export declare function newAbsoluteDashboardDateFilter(from: DateString, to: DateString, dataSet?: ObjRef, localIdentifier?: string, emptyValueHandling?: EmptyValues): IDashboardDateFilter; /** * Creates a new all time date filter. This filter is used to indicate that there should be no filtering on the dates. * * @alpha */ export declare function newAllTimeDashboardDateFilter(dataSet?: ObjRef, localIdentifier?: string, emptyValueHandling?: EmptyValues): IDashboardDateFilter; /** * Type-guard testing whether the provided object is an All time dashboard date filter. * @alpha */ export declare function isAllTimeDashboardDateFilter(obj: unknown): boolean; /** * Type-guard testing whether the provided object is an All time dashboard date filter * with `emptyValueHandling` explicitly defined. * * @remarks * This is useful to distinguish between: * - a "noop" All time filter (implicit default, no additional config), and * - an All time filter that carries extra configuration (e.g. empty date values handling). * * @alpha */ export declare function isAllTimeDashboardDateFilterWithEmptyValueHandling(obj: unknown): obj is IDashboardDateFilter & { dateFilter: { emptyValueHandling: EmptyValues; }; }; /** * Type-guard testing whether the provided object is a noop "All time" dashboard date filter. * * @remarks * This is useful to distinguish between: * - a noop "All time" filter (implicit default, no additional config), and * - an "All time" filter that carries extra configuration (e.g. empty date values handling). * * @alpha */ export declare function isNoopAllTimeDashboardDateFilter(obj: unknown): boolean; /** * Measure value filter of the filter context. * * @remarks * Allows filtering data points across dashboard visualizations based on the value of a metric. * Conditions are OR-ed together (e.g. `value > 100 OR value < 10`). * When `conditions` is empty or undefined, the filter is treated as "All" (no filtering). * * @alpha */ export interface IDashboardMeasureValueFilter { dashboardMeasureValueFilter: { /** * Reference to the metric being filtered. Always uses ObjRef (not LocalIdRef) * because dashboard MVF references a catalog metric, not a local measure in an insight. */ measure: ObjRef; /** * Identifier of the filter which is valid in the scope of the filter context. * Mandatory for dashboard measure value filters. */ localIdentifier: string; /** * OR-ed conditions (comparison or range). Empty or undefined means "All" (no filtering). */ conditions?: MeasureValueFilterCondition[]; /** * Custom title of the filter. If specified has priority over the default metric title. */ title?: string; }; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardMeasureValueFilter}. * @alpha */ export declare function isDashboardMeasureValueFilter(obj: unknown): obj is IDashboardMeasureValueFilter; /** * Type-guard testing whether the provider object is an All values attribute filter * @alpha */ export declare function isAllValuesDashboardAttributeFilter(obj: unknown): boolean; /** * Returns the display form of any attribute-based dashboard filter. * * @alpha */ export declare function dashboardAttributeFilterItemDisplayForm(filter: DashboardAttributeFilterItem): ObjRef; /** * Returns the local identifier of any attribute-based dashboard filter. * * @alpha */ export declare function dashboardAttributeFilterItemLocalIdentifier(filter: DashboardAttributeFilterItem): string | undefined; /** * Returns the title of any attribute-based dashboard filter. * * @alpha */ export declare function dashboardAttributeFilterItemTitle(filter: DashboardAttributeFilterItem): string | undefined; /** * Returns the parent attribute filter dependencies of any attribute-based dashboard filter. * * Standard and arbitrary filters support parent filtering; match filters do not, * so this returns undefined for match filters. * * @alpha */ export declare function dashboardAttributeFilterItemFilterElementsBy(filter: DashboardAttributeFilterItem): IDashboardAttributeFilterParent[] | undefined; /** * Returns the dependent date filter dependencies of any attribute-based dashboard filter. * * Standard and arbitrary filters support dependent date filtering; match filters do not, * so this returns undefined for match filters. * * @alpha */ export declare function dashboardAttributeFilterItemFilterElementsByDate(filter: DashboardAttributeFilterItem): IDashboardAttributeFilterByDate[] | undefined; /** * Returns the validateElementsBy of any attribute-based dashboard filter. * * Standard and arbitrary filters support element validation; match filters do not, * so this returns undefined for match filters. * * @alpha */ export declare function dashboardAttributeFilterItemValidateElementsBy(filter: DashboardAttributeFilterItem): ObjRef[] | undefined; /** * Returns objRef of the dashboard filter. * * For attribute filters (including text mode filters), this will be reference to the display form. * For date filters, it's reference to the data set, or undefined if it's the default date filter. * For measure value filters, it's reference to the metric. * * @alpha */ export declare function dashboardFilterObjRef(filter: FilterContextItem): ObjRef | undefined; /** * Returns local identifier of the dashboard filter. * * @alpha */ export declare function dashboardFilterLocalIdentifier(filter: FilterContextItem): string | undefined; /** * Supported filter context items * @alpha */ export type FilterContextItem = DashboardAttributeFilterItem | IDashboardDateFilter | IDashboardMeasureValueFilter; /** * Type-guard testing whether the provided object is an instance of {@link FilterContextItem}. * @alpha */ export declare function isFilterContextItem(obj: unknown): obj is FilterContextItem; /** * Common filter context properties * * @alpha */ export interface IFilterContextBase { /** * Filter context title */ readonly title: string; /** * Filter context description */ readonly description: string; /** * Attribute or date filters */ readonly filters: FilterContextItem[]; } /** * Filter context definition represents modifier or created filter context * * @alpha */ export interface IFilterContextDefinition extends IFilterContextBase, Partial { } /** * Type-guard testing whether the provided object is an instance of {@link IFilterContextDefinition}. * @alpha */ export declare function isFilterContextDefinition(obj: unknown): obj is IFilterContextDefinition; /** * Filter context consists of configured attribute and date filters * (which could be applied to the dashboard, widget alert, or scheduled email) * * @alpha */ export interface IFilterContext extends IFilterContextBase, IDashboardObjectIdentity { } /** * Type-guard testing whether the provided object is an instance of {@link IFilterContext}. * @alpha */ export declare function isFilterContext(obj: unknown): obj is IFilterContext; /** * Temporary filter context serves to override original dashboard filter context during the dashboard export * * @alpha */ export interface ITempFilterContext { /** * Filter context created time * YYYY-MM-DD HH:mm:ss */ readonly created: string; /** * Attribute or date filters */ readonly filters: FilterContextItem[]; /** * Temp filter context ref */ readonly ref: ObjRef; /** * Temp filter context uri */ readonly uri: string; } /** * Type-guard testing whether the provided object is an instance of {@link ITempFilterContext}. * @alpha */ export declare function isTempFilterContext(obj: unknown): obj is ITempFilterContext; /** * Reference to a particular dashboard date filter * This is commonly used to define filters to ignore * for the particular dashboard widget * * @public */ export interface IDashboardDateFilterReference { /** * Dashboard filter reference type */ type: "dateFilterReference"; /** * DataSet reference of the target date filter */ dataSet: ObjRef; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardDateFilterReference}. * @alpha */ export declare function isDashboardDateFilterReference(obj: unknown): obj is IDashboardDateFilterReference; /** * Reference to a particular dashboard attribute filter * This is commonly used to define filters to ignore * for the particular dashboard widget * * @public */ export interface IDashboardAttributeFilterReference { /** * Dashboard filter reference type */ type: "attributeFilterReference"; /** * Attribute display form reference of the target attribute filter */ displayForm: ObjRef; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardAttributeFilterReference}. * @public */ export declare function isDashboardAttributeFilterReference(obj: unknown): obj is IDashboardAttributeFilterReference; /** * Reference to a particular dashboard measure value filter * This is commonly used to define filters to ignore * for the particular dashboard widget * * @public */ export interface IDashboardMeasureValueFilterReference { /** * Dashboard filter reference type */ type: "measureValueFilterReference"; /** * Metric reference of the target measure value filter */ measure: ObjRef; } /** * Type-guard testing whether the provided object is an instance of {@link IDashboardMeasureValueFilterReference}. * @public */ export declare function isDashboardMeasureValueFilterReference(obj: unknown): obj is IDashboardMeasureValueFilterReference; /** * Reference to a particular dashboard filter * This is commonly used to define filters to ignore * for the particular dashboard widget * * @public */ export type IDashboardFilterReference = IDashboardDateFilterReference | IDashboardAttributeFilterReference | IDashboardMeasureValueFilterReference; /** * Gets reference to object being used for filtering. For attribute filters, this will be reference to the display * form. For date filters this will be reference to the data set. For measure value filters this will be reference * to the metric. * * @alpha */ export declare function dashboardFilterReferenceObjRef(ref: IDashboardFilterReference): ObjRef; /** * Interface that represents saved dashboard filter view created for a specific dashboard by a specific user. * * There should always be just one default filter view for the user and the dashboard at any given time. * The consistency must be handled by backend or client. The reason why the flag cannot be on the dashboard * is that each user can have a different default filter view per dashboard and also the filter views can be * created by users that have only VIEW permission for the workspace and cannot modify the dashboard object. * * @alpha */ export interface IDashboardFilterView { readonly ref: ObjRef; readonly name: string; readonly dashboard: ObjRef; readonly user: ObjRef; readonly filterContext: IFilterContextDefinition; readonly isDefault?: boolean; readonly tabLocalIdentifier?: string; } /** * Interface that represents an entity provided to SPI function that creates a new dashboard filter view * {@link IDashboardFilterView} entity. * * @alpha */ export interface IDashboardFilterViewSaveRequest { readonly name: string; readonly dashboard: ObjRef; readonly filterContext: IFilterContextDefinition; readonly isDefault?: boolean; readonly tabLocalIdentifier?: string; } //# sourceMappingURL=filterContext.d.ts.map