zoomdata-client
Version:
Zoomdata Standalone Web Client (SDK)
1,166 lines (1,011 loc) • 38.4 kB
TypeScript
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// moment-timezone
// chroma-js
// rxjs
declare module 'zoomdata-client' {
import { ServerTimeFormatOptions } from 'zoomdata-client/src/Client/MetaData/MetaField/IMetaField';
export {
IMetaField,
IMetaFieldTime,
TMetaFieldType,
TRawInputField,
TRawMetaFieldTime,
} from './Client/MetaData/MetaField/IMetaField';
export {
IMetaMetric,
TRawMetaMetricField,
TRawInputMetric,
TMetricFunction,
TNumericDataType,
TRawMetaMetricNumericField,
TRawMetaMetricCalc,
TRawMetaMetricCount,
TStartVisFormat,
TRawMetaMetricAttributeField,
} from './Client/MetaData/MetaMetric/IMetaMetric';
export { IMetaAggregation } from 'zoomdata-client/src/Client/MetaData/MetaAggregation/IMetaAggregation';
import { Formatting } from 'zoomdata-client/src/Client/Formatting';
export { Formatting };
export import AggregateFilter = require('zoomdata-client/src/Client/Source/Query/AggregateFilter');
export import ZoomdataTime = require('zoomdata-client/src/Client/ZoomdataTime');
export { locale, Locale } from 'zoomdata-client/src/Client/Locale/typings';
export {
AggregateFilterOperations,
AggregateFilterStartVisFormat,
AggregateComparisonFilterStartVisFormat,
AggregateRangeFilterStartVisFormat,
} from './Client/Source/Query/AggregateFilter';
export { IMetaDataResponse, MetaDataResponseMessage } from 'zoomdata-client/src/Client/MetaData/typings';
export import MetaFieldStat = require('zoomdata-client/src/Client/MetaData/MetaFieldStat');
export { TRawMetaFieldStat } from 'zoomdata-client/src/Client/MetaData/MetaFieldStat';
export * from 'zoomdata-client/src/Client/Source/Query/Filter/TFilter';
export { createClient } from 'zoomdata-client/src/Zoomdata/typings';
export { updateClientCredentials } from 'zoomdata-client/src/Zoomdata/typings';
export { chroma } from 'zoomdata-client/src/Zoomdata/typings';
export import MetaDataRequest = require('zoomdata-client/src/Client/MetaData/MetaDataRequest');
import { IClient } from 'zoomdata-client/src/Client/IClient';
export { IClient };
export { ITimeAPI } from 'zoomdata-client/src/Client/Source/Query/Time/ITimeAPI';
export { colorPalettes, accessibleColorPaletteNames } from 'zoomdata-client/src/Client/Accessors/ColorAccessor/colorLookup';
export { QueryField } from 'zoomdata-client/src/Client/Source/Query';
export type TimestampGranularity =
| 'MILLISECOND'
| 'SECOND'
| 'MINUTE'
| 'HOUR'
| 'DAY'
| 'WEEK'
| 'MONTH'
| 'QUARTER'
| 'YEAR';
interface MetricFormatter {
format: (value: string | number, options?: MetricFormatter.FormatOptions) => string;
}
export function GroupFormatter(
group: any,
data: string,
timeZoneId?: string,
timeFormats?: ServerTimeFormatOptions,
numberFormat?: any,
skipNumberFormatting?: boolean,
): string;
namespace MetricFormatter {
interface FormatOptions {
type?: string;
timeZoneId?: string;
granularity?: TimestampGranularity;
format?: string | Formatting.NumberFieldFormat;
}
}
export const MetricFormatter: {
new (options?: MetricFormatter.FormatOptions): MetricFormatter;
};
export const __setFeatureToggle: (name: string, value: boolean) => void;
export interface Events {
[index: string]: string;
}
export type StringOrNumber = string | number;
export type EventHandler = (...args: any[]) => void;
export const UNAVAILABLE_ATTRIBUTE: string;
const ZoomdataSDK: {
createClient: (options: Options) => Promise<IClient>;
updateClientCredentials: (client: Client, credentials: Credentials) => void;
VariableParser: typeof VariableParser;
VariableStringify: typeof VariableStringify;
MetaDataResponse: typeof MetaDataResponse;
MetaDataRequest: typeof MetaDataRequest;
Formatting: typeof Formatting;
ZoomdataTime: typeof ZoomdataTime;
Locale: typeof Locale;
locale: typeof locale;
MetricFormatter: typeof MetricFormatter;
GroupFormatter: typeof GroupFormatter;
AggregateFilter: typeof AggregateFilter;
colorPalettes: typeof colorPalettes;
accessibleColorPaletteNames: typeof accessibleColorPaletteNames;
__setFeatureToggle: typeof setFeatureToggle;
chroma: typeof chroma;
initTracer: typeof initTracer;
};
export default ZoomdataSDK;
}
declare module 'zoomdata-client/src/Client/MetaData/MetaField/IMetaField' {
import { Formatting } from 'zoomdata-client/src/Client/Formatting';
export interface IMetaField {
toJSON(): TRawInputField;
getFieldName(): FieldName;
getName(): string;
getLabel(): string;
getType(): TMetaFieldType;
}
export interface IMetaFieldTime extends IMetaField {
getType(): 'TIME';
getGranularity(): string;
isPlayable(): boolean;
getTimeZoneId(): string;
getTimeZoneLabel(): string;
getCalendarId(): string;
}
export type TMetaFieldType = 'NUMBER' | 'ATTRIBUTE' | 'TIME' | 'HIERARCHY' | 'NULL';
export type FieldCapabilities = 'PLAYING' | 'METRICS' | 'GROUPING' | 'FILTERING' | 'RAW_DATA' | 'DETAILS';
export type TRawInputField = TRawMetaFieldAttribute | TRawMetaFieldHierarchy | TRawMetaFieldNumber | TRawMetaFieldTime;
export type FieldName = {
label: string;
name: string;
originType?: string;
};
export type TimeGranularity =
| 'MILLISECOND'
| 'SECOND'
| 'MINUTE'
| 'HOUR'
| 'DAY'
| 'WEEK'
| 'MONTH'
| 'QUARTER'
| 'YEAR';
type DefaultMetaField = {
field: FieldName;
disabledCapabilities: FieldCapabilities[];
};
type FacetFiltering = {
enabled: boolean;
order: number;
};
export type UrlFormat = {
type: UrlFormatType;
url?: string;
width?: number;
height?: number;
};
export enum FieldFormatOption {
NUMERIC = 'NUMERIC',
TWO_DIGIT = 'TWO_DIGIT',
}
export enum MonthFormatOption {
NUMERIC = 'NUMERIC',
TWO_DIGIT = 'TWO_DIGIT',
LONG = 'LONG',
SHORT = 'SHORT',
NARROW = 'NARROW',
}
export enum WeekdayFormatOption {
LONG = 'LONG',
SHORT = 'SHORT',
NARROW = 'NARROW',
}
export enum WeekFormatOption {
NARROW = 'NARROW',
RANGE = 'RANGE',
NUMERIC = 'NUMERIC',
WEEK_START = 'WEEK_START',
WEEK_END = 'WEEK_END',
TWO_DIGIT = 'TWO_DIGIT',
}
export enum QuartetFormatOption {
NARROW = 'NARROW',
RANGE = 'RANGE',
NUMERIC = 'NUMERIC',
TWO_DIGIT = 'TWO_DIGIT',
}
export type ServerTimeFormatOptions = {
year: FieldFormatOption;
quarter: QuarterFormatOptions;
month: MonthFormatOption;
week: WeekFormatOptions;
weekday?: WeekdayFormatOption | null;
day: FieldFormatOption;
hour: FieldFormatOption;
minute: FieldFormatOption;
second: FieldFormatOption;
hour12?: boolean;
timeZoneId?: string;
};
export type TRawMetaFieldAttribute = DefaultMetaField & {
distinctValues: boolean;
type: 'ATTRIBUTE';
wildcardFiltersSupport?: {
supports: boolean;
supportsCaseInsensitive: boolean;
supportsCaseSensitive: boolean;
};
facetFiltering?: FacetFiltering;
urlFormat?: UrlFormat;
};
export type TRawMetaFieldHierarchy = DefaultMetaField & {
distinctValues: boolean;
type: 'HIERARCHY';
};
export type TRawMetaFieldNumber = DefaultMetaField & {
min: number;
max: number;
type: 'NUMBER';
numberFieldFormat: Formatting.NumberFieldFormat;
urlFormat?: UrlFormat;
};
export type TRawMetaFieldTime = DefaultMetaField & {
granularity: TimeGranularity;
min: string;
max: string;
playable: boolean;
timeZoneId: string;
timeZoneLabel: string;
type: 'TIME';
timeFormatOptions?: ServerTimeFormatOptions;
calendarId?: string;
};
}
declare module 'zoomdata-client/src/Client/MetaData/MetaAggregation/IMetaAggregation' {
export interface IMetaAggregation {
getType(): TMetaAggregationType;
getName(): string;
getLabel(): string;
toJSON(): TRawInputAggregation;
isEnabled(): boolean;
}
export type TMetaAggregationType = 'TIME' | 'TERMS' | 'HISTOGRAM' | 'HIERARCHY';
export type TRawInputAggregation =
| TRawMetaAggregationHistogram
| TRawMetaAggregationTerm
| TRawMetaAggregationTime
| TRawMetaAggregationHierarchy;
export type TRawMetaAggregationTime = {
type: 'TIME';
field: {
label: string;
name: string;
};
granularities: Array<string>;
timeZoneId: string;
timeZoneLabel: string;
enabled: boolean;
};
export type TRawMetaAggregationTerm = {
type: 'TERMS';
field: {
label: string;
name: string;
};
enabled: boolean;
};
export type TRawMetaAggregationHierarchy = {
type: 'HIERARCHY';
field: {
label: string;
name: string;
};
enabled: boolean;
};
export type TRawMetaAggregationHistogram = {
type: 'HISTOGRAM';
field: {
label: string;
name: string;
};
enabled: boolean;
};
}
declare module 'zoomdata-client/src/Client/Formatting' {
export type FormatInput = string | number | null;
interface FieldFormat {
id?: string;
type: Formatting.FormatType;
decimals: number;
negative: Formatting.Negative;
}
export interface PlainFormat extends FieldFormat {
type: 'PLAIN';
standardUnit: Formatting.StandardUnit;
separator: boolean;
}
export interface CurrencyFormat extends FieldFormat {
type: 'CURRENCY';
standardUnit: Formatting.StandardUnit;
currencyCode: string;
separator: boolean;
}
export interface PercentageFormat extends FieldFormat {
type: 'PERCENTAGE';
separator: boolean;
}
export interface ComputerStorageFormat extends FieldFormat {
type: 'COMPUTER_STORAGE';
storageUnit: Formatting.StorageUnit;
}
export interface ScientificNotationFormat extends FieldFormat {
type: 'SCIENTIFIC_NOTATION';
}
export type NonCurrencyFormat = PlainFormat | PercentageFormat | ComputerStorageFormat | ScientificNotationFormat;
export namespace Formatting {
type FormatType = 'PLAIN' | 'CURRENCY' | 'PERCENTAGE' | 'COMPUTER_STORAGE' | 'SCIENTIFIC_NOTATION';
type StandardUnit = 'NONE' | 'THOUSANDS' | 'MILLIONS' | 'BILLIONS' | 'TRILLIONS';
type StorageUnit = 'BYTES' | 'KILOBYTES' | 'MEGABYTES' | 'GIGABYTES' | 'TERABYTES' | 'PETABYTES' | 'EXABYTES';
type Negative = 'SIGNED' | 'PARENTHESIZED';
type UrlType = 'LINK' | 'IMG';
interface PlainFieldFormat extends PlainFormat {}
interface CurrencyFieldFormat extends CurrencyFormat {}
interface PercentageFieldFormat extends PercentageFormat {}
interface ComputerStorageFieldFormat extends ComputerStorageFormat {}
interface ScientificNotationFieldFormat extends ScientificNotationFormat {}
type NumberFieldFormat = NonCurrencyFormat | CurrencyFormat;
type UrlFormat = {
type: UrlType;
url?: string;
width?: number;
height?: number;
};
type FormatterFunc = (value: FormatInput) => string;
class Formatter {
constructor(localeId?: string);
setLocale(locale: string): void;
getLocale(): string;
format(value: FormatInput, numberFormat: string | NumberFieldFormat): string;
createFormatter(numberFormat: NumberFieldFormat): FormatterFunc;
}
class SmartFormatter {
constructor(localeId?: string);
setLocale(locale: string): void;
getLocale(): string;
format(value: FormatInput): string;
}
function format(value: FormatInput, formatString: string): string;
function getStandardUnitAbbreviation(unit: Formatting.StandardUnit, locale: string): string;
function getStandardUnitMultiplier(unit: Formatting.StandardUnit): number;
function getStorageUnitMultiplier(unit: Formatting.StorageUnit): number;
}
}
declare module 'zoomdata-client/src/Client/Source/Query/AggregateFilter' {
import { IMetaMetric, TStartVisFormat } from 'zoomdata-client/src/Client/MetaData/MetaMetric/IMetaMetric';
export = AggregateFilter;
class AggregateFilter implements AggregateFilter.IAggregateFilter {
constructor(
metaMetric: IMetaMetric,
value: AggregateFilter.TAggregateFilterValue,
operation: AggregateFilter.AggregateFilterOperations,
);
static toStartVisFormat(
metaMetric: IMetaMetric,
value: AggregateFilter.TAggregateFilterValue,
operation: string,
): AggregateFilter.AggregateFilterStartVisFormat;
getOperation(): AggregateFilter.AggregateFilterOperations;
getValue(): AggregateFilter.TAggregateFilterValue;
getMetric(): IMetaMetric;
toStartVisFormat(): AggregateFilter.AggregateFilterStartVisFormat;
}
namespace AggregateFilter {
export type AggregateFilterOperations = AggregateFilterStartVisFormat['operation'];
export type TAggregateFilterValue = string | number | string[] | [string, string] | [number, number];
export interface IAggregateFilter {
getOperation(): AggregateFilter.AggregateFilterOperations;
getValue(): AggregateFilter.TAggregateFilterValue;
getMetric(): IMetaMetric;
toStartVisFormat(): AggregateFilter.AggregateFilterStartVisFormat;
}
export type AggregateFilterStartVisFormat =
| AggregateComparisonFilterStartVisFormat
| AggregateRangeFilterStartVisFormat
| AggregateInclusionFilterStartVisFormat
| AggregateBooleanFilterStartVisFormat;
export interface AggregateComparisonFilterStartVisFormat {
metric: TStartVisFormat;
operation: 'EQUALS' | 'NOTEQUALS' | 'LT' | 'LE' | 'GT' | 'GE';
value: number;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
}
export interface AggregateRangeFilterStartVisFormat {
metric: TStartVisFormat;
operation: 'BETWEEN';
value: [number, number];
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
}
export interface AggregateInclusionFilterStartVisFormat {
metric: TStartVisFormat;
operation: 'IN' | 'NOTIN';
value: number[];
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
}
export interface AggregateBooleanFilterStartVisFormat {
operation: 'AND' | 'OR' | 'NOT';
value: AggregateFilterStartVisFormat[];
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
}
}
}
declare module 'zoomdata-client/src/Client/ZoomdataTime' {
import { Moment, Locale } from 'moment-timezone';
export = ZoomdataTime;
class ZoomdataTime implements ZoomdataTime.IZoomdataTime {
static isPreset(input): boolean;
static convertFromDynamicToTime(input, min, max, timeZoneId): ZoomdataTime;
static getDynamicTimeString(value: string): string;
static convertDynamicTime(value: string, min: number | string, max: number | string, toEnd?: boolean): Date;
static convertFromServerDate(dateString, toEnd?: boolean): Date;
static convertToServerDate(date: string | number | Date, utc?: boolean): string;
static getGranularityByTime(value: string): string;
static getTimeByGranularity(value: string, granularity: string): ZoomdataTime.Time;
static validate(input: any): boolean;
static localeData(locale: string): Locale;
static formatFiscalTimeWithGranularity(
date: string,
granularity: string,
formats?: ServerTimeFormatOptions,
): string;
static extractDateTimeFromFiscal(fiscalTime: string): string;
static getFiscalTimeObject(date: string): {
year: string;
quarter: string;
monthOfYear: string;
dayOfMonth: string;
hours: string;
minutes: string;
seconds: string;
dayOfYear: string;
};
static SERVER_TIME_FORMAT: string;
static PATTERNS: ZoomdataTime.Patterns;
static PATTERNS_DATE: ZoomdataTime.Patterns;
static PATTERNS_TIME: ZoomdataTime.Patterns;
constructor(
input: string | number | Date | ZoomdataTime.Time | ZoomdataTime,
initialTimeZoneId?: string,
localeId?: string,
);
getAsLabel(): string;
setFormat(format: string): ZoomdataTime;
getMomentObject(): ZoomdataTime.Time | undefined;
isPreset(): boolean;
setFormatFromGranularity(granularity: string): ZoomdataTime;
applyTimeZone(timeZone): ZoomdataTime;
getTimeZoneId(): string;
getLocale(): string;
getTimeObject(): ZoomdataTime.Time;
getLabelInServerFormat(): string;
getUnixTime(): number | undefined;
getUnixMsTime(): number | undefined;
format(format: string): string | undefined;
getStringInFormat(format: string): string | undefined;
isEqualTo(compareTo: ZoomdataTime): boolean;
dateFromDynamicTime(min: number, max: number, timeZoneId: string);
setGranularity(granularity: string);
newTimeFormat(selectedFormats: ZoomdataTime.DateTimeFormats, granularity?: string): string;
}
namespace ZoomdataTime {
export type Time = Moment;
interface DateTimeFormats {
year?: YearFormat;
quarter?: QuarterFormat;
month?: MonthFormat;
week?: WeekFormat;
weekday?: WeekdayFormat;
day?: DayFormat;
hour?: HourFormat;
hour12?: string | boolean;
minute?: MinuteFormat;
second?: SecondFormat;
}
export enum YearFormat {
numeric = 'numeric', // 2005
'2-digit' = '2-digit', // 05
}
export enum QuarterFormat {
range = 'range', // 01/01/2022 - 01/04/2022
narrow = 'narrow', //1Q
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
}
export enum MonthFormat {
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
long = 'long', // January
short = 'short', // Jan
narrow = 'narrow', // J
}
export enum WeekFormat {
weekStart = 'weekStart', // 01/01/2022
weekEnd = 'weekEnd', // 07/01/2022
range = 'range', // 01/01/2022 - 07/01/2022
narrow = 'narrow', // 1w
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
}
export enum WeekdayFormat {
long = 'long', // Tuesday
short = 'short', // Tue
narrow = 'narrow', // T
none = 'none',
}
export enum DayFormat {
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
}
export enum HourFormat {
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
}
export enum MinuteFormat {
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
}
export enum SecondFormat {
numeric = 'numeric', // 1
'2-digit' = '2-digit', // 01
}
export type Patterns = {
millisecond: string;
second: string;
minute: string;
hour: string;
day: string;
week: string;
month: string;
quarter: string;
year: string;
decade: string;
};
export interface IZoomdataTime {
getAsLabel(): string;
setFormat(format: string): IZoomdataTime;
getMomentObject(): ZoomdataTime.Time | undefined;
isPreset(): boolean;
setFormatFromGranularity(granularity: string): IZoomdataTime;
applyTimeZone(timeZone): IZoomdataTime;
getTimeZoneId(): string;
getTimeObject(): ZoomdataTime.Time;
getLabelInServerFormat(): string;
getUnixTime(): number | undefined;
getUnixMsTime(): number | undefined;
format(format: string): string | undefined;
getStringInFormat(format: string): string | undefined;
isEqualTo(compareTo: IZoomdataTime): boolean;
dateFromDynamicTime(min: number, max: number, timeZoneId: string);
}
}
}
declare module 'zoomdata-client/src/Client/Locale/typings' {
export const locale: Locale.Locale;
export namespace Locale {
type LocaleSettings = {
id: string;
description: string;
};
type LanguageSettings = {
code: string;
displayName: string;
};
class Locale {
constructor(locale: string);
reset(): LocaleSettings;
setLocaleSettings(settings: LocaleSettings): LocaleSettings;
getLocaleSettings(): LocaleSettings;
setLocale(locale: string): string;
getLocale(): string;
}
}
}
declare module 'zoomdata-client/src/Client/MetaData/typings' {
import { TRawInputAggregation, IMetaAggregation } from 'zoomdata-client/src/Client/MetaData/MetaAggregation/IMetaAggregation';
import { TRawInputField, IMetaField } from 'zoomdata-client/src/Client/MetaData/MetaField/IMetaField';
import { TRawInputMetric, IMetaMetric } from 'zoomdata-client/src/Client/MetaData/MetaMetric/IMetaMetric';
export interface IMetaDataResponse {
getAllAvailableFieldsMap(): Map<string, string>;
getFields(): Array<IMetaField>;
getField(name: string): IMetaField;
getAllMetrics(): Array<IMetaMetric>;
getMetric(name: string): IMetaMetric;
getPercentileMetrics(): Array<IMetaMetric>;
getAttrAggregations(): Array<IMetaAggregation>;
getHistogramAggregations(): Array<IMetaAggregation>;
metaDataResponse: MetaDataResponseMessage;
}
export type MetaDataResponseMessage = {
aggregations: TRawInputAggregation[][];
metrics: TRawInputMetric[][];
filters: Array<any>;
fields: Array<TRawInputField>;
};
}
declare module 'zoomdata-client/src/Client/MetaData/MetaFieldStat' {
import { FieldName } from 'zoomdata-client/src/Client/MetaData/MetaField/IMetaField';
export = MetaFieldStat;
class MetaFieldStat implements MetaFieldStat.IMetaFieldStat {
getName(): string;
getLabel(): string;
getMin(): number | string;
getMax(): number | string;
getType(): 'NUMBER' | 'TIME';
toJSON(): MetaFieldStat.TRawMetaFieldStat;
}
namespace MetaFieldStat {
export interface IMetaFieldStat {
getName(): string;
getLabel(): string;
getMin(): number | string;
getMax(): number | string;
getType(): 'NUMBER' | 'TIME';
toJSON(): TRawMetaFieldStat;
}
export type TRawMetaFieldStat = {
field: FieldName;
type: 'NUMBER' | 'TIME';
min: number | string;
max: number | string;
};
}
}
declare module 'zoomdata-client/src/Client/Source/Query/Filter/TFilter' {
export type TFilter =
| TAttributeFilter
| TTimeFilter
| TTextSearchFilter
| TRangeFilter
| TRangeNotFilter
| TComparisonFilter
| TKeysetFilter
| TWildcardFilter
| TWildcardNotFilter
| TWildcardOrFilter
| TBooleanFilter
| THierarchyFilter;
export type THierarchyFilter = {
operation: 'EQUALS_OR_DESCENDANT_OF';
path: TField;
value: string | string[];
custom?: { valueLabel: string | string[] };
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TAttributeFilter = {
operation: 'IN' | 'NOTIN';
path: TField;
value: string[];
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TTimeFilter = {
operation: 'BETWEEN';
path: TField;
value: [string, string];
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TTextSearchFilter = {
operation: 'TEXT_SEARCH';
path?: null;
value: string;
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TRangeFilter = {
operation: 'BETWEEN';
path: TField;
value: [number, number];
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TRangeNotFilter = {
operation: 'NOT';
path?: null;
value: [TRangeFilter];
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TWildcardOrFilter = {
operation: 'OR';
path?: null;
value: Array<TWildcardFilter | TWildcardNotFilter>;
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TBooleanFilter = {
operation: 'OR' | 'AND';
path?: null;
value: TFilter[];
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TComparisonFilter = {
operation: 'GT' | 'GE' | 'EQUALS' | 'NOTEQUALS' | 'LE' | 'LT';
path: TField;
value: number;
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TKeysetFilter = {
operation: 'INKEYSET' | 'NOTINKEYSET';
path: TField;
value: string;
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TWildcardFilter = {
operation:
| 'STARTSWITH_CS'
| 'STARTSWITH_CI'
| 'STARTSWITH_DS'
| 'ENDSWITH_CS'
| 'ENDSWITH_CI'
| 'ENDSWITH_DS'
| 'CONTAINS_CS'
| 'CONTAINS_CI'
| 'CONTAINS_DS';
path: TField;
value: string;
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TWildcardNotFilter = {
operation: 'NOT';
path?: null;
value: [TWildcardFilter];
forTopic?: string;
isUnavailable?: 'NOT_FOUND' | 'TYPE_MISMATCH';
};
export type TField = {
name: string;
label?: string;
type?: string;
};
}
declare module 'zoomdata-client/src/Zoomdata/typings' {
import chroma from 'chroma-js';
import { IClient } from 'zoomdata-client/src/Client/IClient';
type TApplication = {
host?: string;
path: string;
port?: number;
secure?: boolean;
};
type TCredentials = {
access_token?: string;
};
type ApplicationConfig = {
vocabulary: any;
application: TApplication;
credentials: TCredentials | any;
visualizations: any[];
};
export function createClient(applicationConfig: ApplicationConfig): Promise<IClient>;
export function updateClientCredentials(client: IClient, credentials: TCredentials);
export { chroma };
export const UNAVAILABLE_ATTRIBUTE: string;
}
declare module 'zoomdata-client/src/Client/MetaData/MetaDataRequest' {
import { Field, Metric } from 'zoomdata-client/src/Client/Source/Query';
import { FieldName } from 'zoomdata-client/src/Client/MetaData/MetaField/IMetaField';
export = MetaDataRequest;
class MetaDataRequest implements MetaDataRequest.IMetaDataRequest {
getRequest(): MetaDataRequest.MetaDataOutgoingMessage;
getFieldStatisticRequest(
cid: string,
sourceId: string,
fieldName: FieldName,
): MetaDataRequest.MetaFieldStatOutgoingMessage;
static getRequestFromQuery(queryAPI: any): MetaDataRequest.MetaDataOutgoingMessage;
constructor(queryAPI?: any);
}
namespace MetaDataRequest {
export type MetaDataOutgoingMessage = {
api: 'META';
type: 'ALL';
aggregations?: Array<any>;
metrics?: Array<Metric>;
fields?: Array<Field>;
timeField?: {
name: string;
};
};
export type MetaFieldStatOutgoingMessage = {
cid: string;
api: 'META';
type: 'FIELD_STAT';
sourceId: string;
fieldName: FieldName;
};
export interface IMetaDataRequest {
getRequest(): MetaDataOutgoingMessage;
getFieldStatisticRequest(cid: string, sourceId: string, fieldName: FieldName): MetaFieldStatOutgoingMessage;
}
}
}
declare module 'zoomdata-client/src/Client/IClient' {
type ObjectShorthand<T> = string | [string, any] | Partial<T>;
type Predicate<T> = (item: T) => boolean;
type Iteratee<T> = Predicate<T> | ObjectShorthand<T>;
interface CollectionModifier<T> {
get: (predicate?: Iteratee<T>) => Array<T>;
add: (newItem: T) => void;
find: (predicate: Iteratee<T>, fromIndex?: number) => T;
fetch: (params: Partial<T>) => Promise<Array<T>>;
update: (params: Partial<T>) => Promise<void>;
}
interface CreateQueryOptions {
/**
* Source id
*/
id: string;
/**
* Source name
* @deprecated
* Please, use `id` property instead.
*/
name?: string;
}
export interface IClient {
threadServiceStream: any;
threadMessageStream: any;
updateThreadCredentials: any;
threadInvalidAuthMessages: any;
mode: number;
close(reconnectOnClose: boolean): void;
getHomePath(): string;
createAggregatedQuery(sourceId: string): Promise<any>;
runQueryForSourceId(queryAPI: any, sourceId: string): Promise<any>;
createRawQuery(sourceId: string): Promise<any>;
runQuery(query: any, onUpdate: Function, onError: Function);
switchVis(options: any, additionalOptions: any): Promise<any>;
getCredentials(): any;
createQuery(options: CreateQueryOptions, metaThread: IMetaThread | null, queryPayload: any): Promise<any>;
createQueryFromConfig(options: {
source: any;
visualization: any;
metaThread: IMetaThread | null;
variables: any;
config: any;
}): Promise<any>;
visualize(options: {
element: HTMLElement;
visualization: string;
autoStart?: boolean;
variables?: Record<string, any>;
theme: any;
query?: any;
config?: any;
interactive?: boolean;
interactivityProfile?: any;
widget?: any;
source?: any;
visualId?: string;
dashboardId?: string;
menuEventsConfig?: any;
componentInstanceId?: string;
visualLegendType?: any;
}): any;
createMetaThread(query: any): Promise<IMetaThread>;
metaDataCache: Map<string, any>;
sources: CollectionModifier<any>;
visualizations: CollectionModifier<any>;
componentInstanceId: string;
}
}
declare module 'zoomdata-client/src/Client/Source/Query/Time/ITimeAPI' {
import { Observable } from 'rxjs';
export interface ITimeAPI {
changes: Observable<any>;
getTimeField(): string;
get(path?: string): any;
}
}
declare module 'zoomdata-client/src/Client/Accessors/ColorAccessor/colorLookup' {
export const colorPalettes: {
[colorPalette: string]: { [colorNumber: number]: string[] };
add: (palette: { [colorNumber: number]: string[] }) => void;
names: string[];
};
export const accessibleColorPaletteNames: string[];
}
declare module 'zoomdata-client/src/Client/Source/Query' {
export type FieldName = {
name: string;
label?: string;
};
export type Field = {
field: FieldName;
type: string;
min: number;
max: number;
};
export type QueryField = {
type: 'FIELD';
field: {
name: string;
label?: string;
type?: string;
};
};
export type Metric = {
type: 'FIELD' | 'COUNT' | 'CALC';
function?: 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'DISTINCT_COUNT' | 'LAST_VALUE' | 'PERCENTILE';
field: FieldName;
formulaName?: string;
};
}
declare module 'zoomdata-client/src/Client/MetaData/MetaMetric/IMetaMetric' {
import { Formatting } from 'zoomdata-client/src/Client/Formatting';
import { ServerTimeFormatOptions, TimeGranularity } from 'zoomdata-client/src/Client/MetaData/MetaField/IMetaField';
export interface IMetaMetric {
getFunc(): string;
getName(): string;
getLabel(): string;
getType(): TMetaMetricType;
getNumberFieldFormat(): Formatting.NumberFieldFormat;
toJSON(): TRawInputMetric;
toStartVisFormat(): TStartVisFormat | TStartVisFormat[];
}
export type TMetaMetricType = 'COUNT' | 'CALC' | 'FIELD';
export type TMetricFunction = 'AVG' | 'MAX' | 'MIN' | 'SUM' | 'DISTINCT_COUNT' | 'LAST_VALUE' | 'PERCENTILE';
export type TNumericDataType = 'NUMBER';
export type TRawInputMetric = TRawMetaMetricField | TRawMetaMetricCount | TRawMetaMetricCalc;
export type TRawMetaMetricField =
| TRawMetaMetricNumericField
| (TRawMetaMetricAttributeField & {
numberFieldFormat?: Formatting.NumberFieldFormat;
});
export type TRawMetaMetricNumericField<TFunction extends TMetricFunction = TMetricFunction> = {
default: boolean;
dataType: TNumericDataType;
enabled: boolean;
field: TMetricField;
type: 'FIELD';
function: TMetricFunction;
numberFieldFormat: Formatting.NumberFieldFormat;
supportsRollup: boolean;
};
export type TRawMetaMetricAttributeField = {
default: boolean;
dataType: 'ATTRIBUTE';
enabled: boolean;
field: TMetricField;
type: 'FIELD';
function: 'DISTINCT_COUNT';
supportsRollup: boolean;
};
export type TRawMetaMetricCount = {
enabled: boolean;
label: string;
type: 'COUNT';
numberFieldFormat: Formatting.NumberFieldFormat;
supportsRollup: boolean;
};
export type TRawMetaMetricCalc = {
enabled: boolean;
formulaName: string;
formulaLabel: string;
expression: string;
type: 'CALC';
dataType: 'ATTRIBUTE' | 'TIME' | 'NUMBER';
numberFieldFormat: Formatting.NumberFieldFormat;
supportsRollup: boolean;
timeFieldFormat?: ServerTimeFormatOptions;
granularity?: TimeGranularity;
};
export type TStartVisFormat = TCountMetric | TFieldMetric | TPercentileMetric | TCalculationMetric;
export type TMetricField = {
name: string;
label?: string;
type?: string;
originType?: string;
};
export type TCountMetric = {
type: 'COUNT';
label?: string;
};
export type TFieldMetric = {
type: 'FIELD';
field: TMetricField;
function: TMetricFunction;
};
export type TPercentileMetric = {
type: 'FIELD';
field: TFieldMetric;
function: 'PERCENTILE';
quantile: number;
};
export type TCalculationMetric = {
type: 'CALCULATION';
formulaName: string;
formula?: string;
label?: string;
};
}