import { Attribute, DataSource, Measure, PivotAttribute, PivotMeasure, PivotQueryResultData, QueryResultData } from '@sisense/sdk-data'; import type { PivotQueryDescription as InternalPivotQueryDescription, QueryDescription as InternalQueryDescription, QueryExecutionConfig } from '@sisense/sdk-query-client'; import { CacheKey, CreateCacheKeyFn } from '../../../shared/utils/create-cache'; import { type ClientApplication } from '../../../infra/app/types.js'; /** * All the properties that fully describe a query you want to send. * * We use "dimensions" in public interface because the term is closer to the query and charting * as used in the industry (Sisense included). * internally, "dimensions" are represented by attributes as the latter is closer to the data model. */ export type QueryDescription = Partial> & { dimensions?: Attribute[]; }; /** * All the properties that fully describe a pivot query you want to send. * * We use "dimensions" in public interface because the term is closer to the query and charting * as used in the industry (Sisense included). * internally, "dimensions" are represented by attributes as the latter is closer to the data model. * */ export type PivotQueryDescription = Partial> & { rows?: (Attribute | PivotAttribute)[]; columns?: (Attribute | PivotAttribute)[]; values?: (Measure | PivotMeasure)[]; }; /** @internal */ export declare const prepareQueryParams: (queryDescription: QueryDescription, defaultDataSource?: DataSource) => InternalQueryDescription; /** @internal */ export declare function executeQuery(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig): Promise; /** @internal */ export declare function executeRowCountQuery(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig): Promise; /** Result of a data query executed together with its total row count. */ export type QueryResultWithRowCount = { data: QueryResultData; /** * Total row count of the query, ignoring `count`/`offset` paging. * Undefined when the total could not be retrieved. */ rowCount?: number; }; /** * Executes a data query together with a row count query and returns both the * result data and the total row count. * * A row count failure does not fail the data query: `rowCount` is left * undefined when the total cannot be retrieved (e.g. a Sisense instance * without the row count API). * * @internal */ export declare function executeQueryWithRowCount(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig, baseExecuteQuery?: typeof executeQuery): Promise; /** @internal */ export declare const executeCsvQuery: (queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise; /** @internal */ export declare const executePivotQuery: (queryDescription: PivotQueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise; export declare const createExecuteQueryCacheKey: CreateCacheKeyFn; export declare const executeQueryWithCache: typeof executeQuery; export declare const clearExecuteQueryCache: (specificKey?: string | undefined) => void; /** * Creates a cache key for a row count query. * * The key is page-independent: `count` and `offset` are excluded so the total * row count is reused across pages of the same query. * * @internal */ export declare const createRowCountQueryCacheKey: CreateCacheKeyFn; /** @internal */ export declare const clearRowCountQueryCache: (specificKey?: CacheKey) => void;