@vizzly/services 0.7.1 → 0.7.2-dev-dba36cbd0af6b3bcb07804673072c6fb5fb27a1f
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/index.js +1 -1
- package/dist/services/src/Services/DashboardServices.d.ts +2 -1
- package/dist/shared-logic/src/AI/types.d.ts +25 -6
- package/dist/shared-logic/src/AdditionalFilter/AdditionalFilter.d.ts +4 -3
- package/dist/shared-logic/src/Aggregate/constants.d.ts +26 -0
- package/dist/shared-logic/src/AreaChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/BarChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/BasicTable/constants.d.ts +3 -0
- package/dist/shared-logic/src/ComboChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/Component/sharedSchemas.d.ts +6 -5
- package/dist/shared-logic/src/ComponentInterface/constants.d.ts +63 -0
- package/dist/shared-logic/src/ComponentInterface/namespaces.d.ts +3 -0
- package/dist/shared-logic/src/ComponentInterface/types/ComponentInterfaceConfig.d.ts +18 -0
- package/dist/shared-logic/src/ComponentInterface/types/namespaces.types.d.ts +104 -0
- package/dist/shared-logic/src/ComponentInterface/types.d.ts +4 -4
- package/dist/shared-logic/src/Dashboard/fromRaw.d.ts +2 -1
- package/dist/shared-logic/src/DashboardAPI/dashboardAPI/creating.d.ts +2 -1
- package/dist/shared-logic/src/DashboardAPI/dashboardAPI/updating.d.ts +2 -1
- package/dist/shared-logic/src/DashboardAPI/dashboardAPI.d.ts +1 -1
- package/dist/shared-logic/src/DataPanelConfig/types.d.ts +4 -5
- package/dist/shared-logic/src/DataSet/DataSet.d.ts +5 -0
- package/dist/shared-logic/src/DataSet/types.d.ts +1 -0
- package/dist/shared-logic/src/DataTable/constants.d.ts +3 -0
- package/dist/shared-logic/src/Display/Display.d.ts +2 -2
- package/dist/shared-logic/src/Display/upcast.d.ts +2 -1
- package/dist/shared-logic/src/Dumpable.d.ts +2 -1
- package/dist/shared-logic/src/Field/Field.d.ts +6 -3
- package/dist/shared-logic/src/Field/types.d.ts +1 -0
- package/dist/shared-logic/src/HorizontalBarChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/LineChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/MercatorMap/constants.d.ts +3 -0
- package/dist/shared-logic/src/PieChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/Progress/constants.d.ts +3 -0
- package/dist/shared-logic/src/QueryAttributes/QueryAttributes.d.ts +2 -1
- package/dist/shared-logic/src/QueryAttributes/constants.d.ts +54 -0
- package/dist/shared-logic/src/ScatterChart/constants.d.ts +3 -0
- package/dist/shared-logic/src/SingleStat/constants.d.ts +3 -0
- package/dist/shared-logic/src/Theme/types.d.ts +27 -0
- package/dist/shared-logic/src/TimeDimension/constants.d.ts +34 -0
- package/dist/shared-logic/src/Translations/extract/shared.d.ts +10 -0
- package/dist/shared-logic/src/Translations/textOverrideComponent.d.ts +30 -0
- package/dist/shared-logic/src/Translations/translation.schema.d.ts +2 -0
- package/dist/shared-logic/src/Translations/translation.types.d.ts +4748 -0
- package/dist/shared-logic/src/Translations/translations.d.ts +9 -0
- package/dist/shared-logic/src/Translations/types.d.ts +13 -0
- package/dist/shared-logic/src/Translations/validation.d.ts +1 -0
- package/dist/shared-logic/src/api/index.d.ts +3 -9
- package/dist/shared-logic/src/api/vizzly/aiActions.d.ts +18 -0
- package/dist/shared-logic/src/api/vizzly/aiHelpers/buildAIResponse.d.ts +5 -0
- package/dist/shared-logic/src/api/vizzly/aiHelpers/buildDataSets.d.ts +4 -0
- package/dist/shared-logic/src/api/vizzly/aiHelpers/checkAiResponseStatus.d.ts +3 -0
- package/dist/shared-logic/src/api/vizzly/aiHelpers/types.d.ts +23 -0
- package/dist/shared-logic/src/api/vizzly/aiHelpers/validateAndUpcastAIAttributes.d.ts +4 -0
- package/dist/shared-logic/src/api/vizzly/aiHelpers/view.d.ts +10 -0
- package/dist/shared-logic/src/api/vizzly/askAi.d.ts +2 -8
- package/dist/shared-logic/src/api/vizzly/askAiForQuestionSuggestions.d.ts +4 -0
- package/dist/shared-logic/src/errors/AIAborted.d.ts +4 -0
- package/dist/shared-logic/src/errors/AIContainsErrors.d.ts +4 -0
- package/dist/shared-logic/src/errors/AIFailedToFetch.d.ts +4 -0
- package/dist/shared-logic/src/errors/AIUsageLimitReached.d.ts +1 -1
- package/dist/shared-logic/src/errors/index.d.ts +5 -0
- package/dist/shared-logic/src/utils/stringHelper.d.ts +2 -1
- package/package.json +1 -1
- package/dist/shared-logic/src/Documentation/index.d.ts +0 -2
- package/dist/shared-logic/src/Documentation/joiToDocumentation.d.ts +0 -4
- package/dist/shared-logic/src/Documentation/joiToSchemaDefinition.d.ts +0 -2
- package/dist/shared-logic/src/api/vizzly/askAi/types.d.ts +0 -2
- package/dist/shared-logic/src/api/vizzly/askAi/validateAndUpcast.d.ts +0 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as DashboardTypes from '../../../shared-logic/src/Dashboard/types';
|
|
1
2
|
import { Row } from './RowServices';
|
|
2
3
|
import { CustomField } from '../../../shared-logic/src/CustomField/types';
|
|
3
4
|
import { Header } from './HeaderServices';
|
|
@@ -50,5 +51,5 @@ export declare class Dashboard<T> {
|
|
|
50
51
|
* Builds a partial DashboardType object.
|
|
51
52
|
* @returns A partial DashboardType object.
|
|
52
53
|
*/
|
|
53
|
-
build
|
|
54
|
+
build(): DashboardTypes.SaveableDashboardDefinition;
|
|
54
55
|
}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
export declare enum SenderType {
|
|
2
|
+
User = "user",
|
|
3
|
+
AI = "ai"
|
|
4
|
+
}
|
|
5
|
+
export declare enum MessageState {
|
|
6
|
+
WaitingForMessage = "waitingForMessage",
|
|
7
|
+
Thinking = "thinking"
|
|
8
|
+
}
|
|
9
|
+
export declare enum AIReaction {
|
|
10
|
+
ThumbsUp = "thumbs_up",
|
|
11
|
+
ThumbsDown = "thumbs_down"
|
|
12
|
+
}
|
|
13
|
+
export type Message = {
|
|
2
14
|
content: string;
|
|
3
|
-
sender_type:
|
|
15
|
+
sender_type: SenderType;
|
|
4
16
|
status: 'active';
|
|
5
|
-
|
|
17
|
+
id: string;
|
|
18
|
+
sent_at: Date;
|
|
19
|
+
reaction: AIReaction | null;
|
|
20
|
+
};
|
|
6
21
|
export type ConversationState = {
|
|
7
22
|
message: string;
|
|
8
23
|
conversationId: string | undefined;
|
|
9
|
-
messageState:
|
|
10
|
-
messageHistory:
|
|
24
|
+
messageState: MessageState;
|
|
25
|
+
messageHistory: Message[];
|
|
11
26
|
};
|
|
12
|
-
export {
|
|
27
|
+
export declare enum AIFeedback {
|
|
28
|
+
Warning = "warning",
|
|
29
|
+
Critical = "critical",
|
|
30
|
+
Info = "info"
|
|
31
|
+
}
|
|
@@ -3,14 +3,15 @@ import { QueryAttributes } from '../QueryAttributes/types';
|
|
|
3
3
|
import { AdditionalFilter, TimeRangeOptions, FilterConfig, OptionalFilters } from './types';
|
|
4
4
|
import { DataSet } from '../DataSet/types';
|
|
5
5
|
import { DateTimeFilterOptions } from '../DateTime/types';
|
|
6
|
-
|
|
6
|
+
import { TextOverride } from '../Translations/types';
|
|
7
|
+
export declare const typeToString: (type: AdditionalFilter['type'], textOverride: TextOverride) => string;
|
|
7
8
|
export declare const allowedDataTypesForFilter: (type: AdditionalFilter['type']) => Array<DataType>;
|
|
8
9
|
export declare const dump: (hydrated: AdditionalFilter) => AdditionalFilter;
|
|
9
|
-
export declare const load: (dumped: AdditionalFilter) => AdditionalFilter;
|
|
10
|
+
export declare const load: (dumped: AdditionalFilter, componentInterfaceConfig?: import("../ComponentInterface/types").ComponentInterfaceConfig | undefined) => AdditionalFilter;
|
|
10
11
|
export declare const toQueryAttributesFilter: (dataSet: DataSet, filter: AdditionalFilter, customTimeRangeFuncs: TimeRangeOptions) => QueryAttributes.Filter[];
|
|
11
12
|
export declare const fromFilterConfig: (filterConfig: FilterConfig, dataSet: DataSet, timeRangeOptions: TimeRangeOptions) => QueryAttributes.Filter[];
|
|
12
13
|
export declare const hasActiveFilter: (additionalFilters: AdditionalFilter[]) => boolean;
|
|
13
|
-
export declare const getTitle: (additionalFilter: AdditionalFilter, dataSets: DataSet[]) => string;
|
|
14
|
+
export declare const getTitle: (additionalFilter: AdditionalFilter, dataSets: DataSet[], textOverride?: TextOverride) => string;
|
|
14
15
|
export declare const requiredFiltersAreSet: (filter: AdditionalFilter | AdditionalFilter[]) => boolean;
|
|
15
16
|
export declare const isReady: (additionalFilter: AdditionalFilter) => boolean;
|
|
16
17
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const supportedAggregatesConstants: {
|
|
2
|
+
mean: {
|
|
3
|
+
publicName: string;
|
|
4
|
+
validDataTypes: string[];
|
|
5
|
+
};
|
|
6
|
+
sum: {
|
|
7
|
+
publicName: string;
|
|
8
|
+
validDataTypes: string[];
|
|
9
|
+
};
|
|
10
|
+
min: {
|
|
11
|
+
publicName: string;
|
|
12
|
+
validDataTypes: string[];
|
|
13
|
+
};
|
|
14
|
+
max: {
|
|
15
|
+
publicName: string;
|
|
16
|
+
validDataTypes: string[];
|
|
17
|
+
};
|
|
18
|
+
count: {
|
|
19
|
+
publicName: string;
|
|
20
|
+
validDataTypes: string[];
|
|
21
|
+
};
|
|
22
|
+
countDistinct: {
|
|
23
|
+
publicName: string;
|
|
24
|
+
validDataTypes: string[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -2,15 +2,16 @@ import Joi from '@vizzly/joi';
|
|
|
2
2
|
import { SupportedAggregates } from '../Aggregate';
|
|
3
3
|
import { QueryEngineConfig } from '../QueryEngineConfig/types';
|
|
4
4
|
import { SupportedTimeTruncFunctions } from '../TimeDimension/types';
|
|
5
|
+
import { ComponentInterfaceConfig } from '../ComponentInterface/types';
|
|
5
6
|
export declare const additionalFilterSchema: (queryEngineConfig: QueryEngineConfig, shouldAlwaysHaveValue?: boolean) => Joi.Schema;
|
|
6
|
-
export declare const measureSchema: (supportedAggregates: SupportedAggregates) => Joi.ObjectSchema<any>;
|
|
7
|
+
export declare const measureSchema: (supportedAggregates: SupportedAggregates, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.ObjectSchema<any> | Joi.AlternativesSchema<any>;
|
|
7
8
|
export declare const orderSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
|
|
8
9
|
export declare const timeDimensionSchema: (supportedTimeTruncFunctions: SupportedTimeTruncFunctions) => Joi.ObjectSchema<any>;
|
|
9
|
-
export declare const dimensionSchema: (supportedTimeTruncFunctions: SupportedTimeTruncFunctions) => Joi.ArraySchema<any[]>;
|
|
10
|
+
export declare const dimensionSchema: (supportedTimeTruncFunctions: SupportedTimeTruncFunctions, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.ArraySchema<any[]>;
|
|
10
11
|
export declare const filterSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
|
|
11
12
|
export declare const queryAttributesFilter: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
|
|
12
13
|
export declare const queryAttributesLimit: () => Joi.NumberSchema<number>;
|
|
13
|
-
export declare const baseAttributesSchema: {
|
|
14
|
+
export declare const baseAttributesSchema: (attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => {
|
|
14
15
|
viewId: Joi.StringSchema<string>;
|
|
15
16
|
displayTitle: Joi.StringSchema<string>;
|
|
16
17
|
displaySubject: Joi.StringSchema<string>;
|
|
@@ -18,7 +19,7 @@ export declare const baseAttributesSchema: {
|
|
|
18
19
|
protectedByOrganisation: Joi.BooleanSchema<boolean>;
|
|
19
20
|
};
|
|
20
21
|
export declare const approxAxisLabelCountSchema: Joi.AnySchema<any>;
|
|
21
|
-
export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineConfig) => {
|
|
22
|
+
export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineConfig, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => {
|
|
22
23
|
measure: Joi.ArraySchema<any[]>;
|
|
23
24
|
dimension: Joi.ArraySchema<any[]>;
|
|
24
25
|
drilldown: Joi.AlternativesSchema<string | any[]>;
|
|
@@ -39,7 +40,7 @@ export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineCo
|
|
|
39
40
|
export declare const lineCurveSchema: Joi.StringSchema<string>;
|
|
40
41
|
export declare const protectedFieldsMeasure: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
|
|
41
42
|
export declare const protectedFieldsDimension: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
|
|
42
|
-
export declare const parametersSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
|
|
43
|
+
export declare const parametersSchema: (queryEngineConfig: QueryEngineConfig, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.ObjectSchema<any>;
|
|
43
44
|
export declare const goalLineSchema: () => Joi.ObjectSchema<any>;
|
|
44
45
|
export declare const goalLinesSchema: () => Joi.ArraySchema<any[]>;
|
|
45
46
|
export declare const axisTitleSchema: () => Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Section } from '../DataPanelConfig/types';
|
|
2
|
+
import { ViewConstants } from './types/namespaces.types';
|
|
3
|
+
export declare function headingConstant(constants: ViewConstants): {
|
|
4
|
+
subSection: (Section<"title"> | Section<"subject">)[];
|
|
5
|
+
type?: "heading" | undefined;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string | undefined;
|
|
8
|
+
callToAction?: string | undefined;
|
|
9
|
+
testId?: string | undefined;
|
|
10
|
+
namespace?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function axisLabelsConstants(constants: ViewConstants): {
|
|
13
|
+
y: {
|
|
14
|
+
prefix: Section<"axisLabels">;
|
|
15
|
+
postfix: Section<"axisLabels">;
|
|
16
|
+
format: Section<"axisLabels">;
|
|
17
|
+
count: Section<"axisLabels">;
|
|
18
|
+
axisTitle: Section<"axisLabels">;
|
|
19
|
+
type?: "axisLabels" | undefined;
|
|
20
|
+
title: string;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
callToAction?: string | undefined;
|
|
23
|
+
testId?: string | undefined;
|
|
24
|
+
namespace?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
x: {
|
|
27
|
+
prefix: Section<"axisLabels">;
|
|
28
|
+
postfix: Section<"axisLabels">;
|
|
29
|
+
format: Section<"axisLabels">;
|
|
30
|
+
count: Section<"axisLabels">;
|
|
31
|
+
axisTitle: Section<"axisLabels">;
|
|
32
|
+
type?: "axisLabels" | undefined;
|
|
33
|
+
title: string;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
callToAction?: string | undefined;
|
|
36
|
+
testId?: string | undefined;
|
|
37
|
+
namespace?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
type?: "axisLabels" | undefined;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
callToAction?: string | undefined;
|
|
43
|
+
testId?: string | undefined;
|
|
44
|
+
namespace?: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
export declare function chartStylesConstant(constants: ViewConstants, line: boolean, bar: boolean): {
|
|
47
|
+
subSection: (Section<"curve"> | Section<"legend">)[];
|
|
48
|
+
type?: "chartStyles" | undefined;
|
|
49
|
+
title: string;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
callToAction?: string | undefined;
|
|
52
|
+
testId?: string | undefined;
|
|
53
|
+
namespace?: string | undefined;
|
|
54
|
+
} | {
|
|
55
|
+
subSection: (Section<"legend"> | Section<"stacked">)[];
|
|
56
|
+
type?: "chartStyles" | undefined;
|
|
57
|
+
title: string;
|
|
58
|
+
description?: string | undefined;
|
|
59
|
+
callToAction?: string | undefined;
|
|
60
|
+
testId?: string | undefined;
|
|
61
|
+
namespace?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
export declare function statsLabelsConstant(constants: ViewConstants, namespace: string): Omit<Section<'statsLabels'>, 'type'>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataSet } from '../../DataSet/types';
|
|
2
|
+
import { QueryEngineConfig } from '../../QueryEngineConfig/types';
|
|
3
|
+
import { TextOverride } from '../../Translations/types';
|
|
4
|
+
export type ComponentInterfaceConfig = {
|
|
5
|
+
queryEngineConfig: QueryEngineConfig;
|
|
6
|
+
attributesSchemaOptions?: {
|
|
7
|
+
restrictFields?: Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
dataType: DataSet['fields'][number]['dataType'];
|
|
10
|
+
publicName?: string;
|
|
11
|
+
description?: DataSet['fields'][number]['description'];
|
|
12
|
+
canBeDimension: boolean;
|
|
13
|
+
canBeMeasure: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
restrictDataSetIds?: string[];
|
|
16
|
+
};
|
|
17
|
+
textOverride?: TextOverride;
|
|
18
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export type Section<Type> = {
|
|
2
|
+
type?: Type;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
callToAction?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ViewConstants = {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
namespace: ComponentNamespace;
|
|
11
|
+
data_panel: DataPanelNamespaces;
|
|
12
|
+
format_panel: FormatPanelNamespaces;
|
|
13
|
+
};
|
|
14
|
+
export type SubSection<Type> = Section<Type> & {
|
|
15
|
+
namespace?: string;
|
|
16
|
+
};
|
|
17
|
+
type SubSectionDef = {
|
|
18
|
+
line?: SubSection<'metrics'>;
|
|
19
|
+
bar?: SubSection<'metrics'>;
|
|
20
|
+
xAxis?: SubSection<'metrics'>;
|
|
21
|
+
yAxis?: SubSection<'metrics'>;
|
|
22
|
+
};
|
|
23
|
+
export interface DataPanelNamespaces {
|
|
24
|
+
data_set: Section<'dataSet'>;
|
|
25
|
+
views: Section<'views'>;
|
|
26
|
+
fields?: Section<'fields'>;
|
|
27
|
+
field_y_axis?: Section<'fieldCollector'>;
|
|
28
|
+
field_rows?: Section<'fieldCollector'>;
|
|
29
|
+
field_columns?: Section<'fieldCollector'>;
|
|
30
|
+
field_metrics?: Section<'fieldCollector'>;
|
|
31
|
+
field_grouping?: Section<'fieldCollector'>;
|
|
32
|
+
progress_goals?: Section<'progressGoals'>;
|
|
33
|
+
drilldown?: Section<'drilldown'>;
|
|
34
|
+
field_x_axis?: Section<'fieldCollector'>;
|
|
35
|
+
field_country?: Section<'fieldCollector'>;
|
|
36
|
+
sort?: Section<'sort'>;
|
|
37
|
+
filter: Section<'filter'>;
|
|
38
|
+
custom_metrics: Section<'customMetrics'>;
|
|
39
|
+
limit?: Section<'limit'>;
|
|
40
|
+
pagination?: Section<'pagination'>;
|
|
41
|
+
combo_chart_dimension?: Section<'comboChartDimension'>;
|
|
42
|
+
comparison?: Section<'comparison'>;
|
|
43
|
+
labelled_metrics?: Section<'labelledMetrics'> & {
|
|
44
|
+
subSectionDefinition: SubSectionDef;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export type Namespace = keyof FormatPanelNamespaces | keyof DataPanelNamespaces;
|
|
48
|
+
export interface FormatPanelNamespaces {
|
|
49
|
+
axis_labels?: Section<'axisLabels'> & {
|
|
50
|
+
subSectionDefinition: {
|
|
51
|
+
x: SubSection<'axisLabels'>;
|
|
52
|
+
'x.prefix': SubSection<'axisLabels'>;
|
|
53
|
+
'x.postfix': SubSection<'axisLabels'>;
|
|
54
|
+
'x.format': SubSection<'axisLabels'>;
|
|
55
|
+
'x.count': SubSection<'axisLabels'>;
|
|
56
|
+
'x.axis_title': SubSection<'axisLabels'>;
|
|
57
|
+
y: SubSection<'axisLabels'>;
|
|
58
|
+
'y.prefix': SubSection<'axisLabels'>;
|
|
59
|
+
'y.postfix': SubSection<'axisLabels'>;
|
|
60
|
+
'y.format': SubSection<'axisLabels'>;
|
|
61
|
+
'y.count': SubSection<'axisLabels'>;
|
|
62
|
+
'y.axis_title': SubSection<'axisLabels'>;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
stats_labels?: Section<'statsLabels'> & {
|
|
66
|
+
subSectionDefinition: {
|
|
67
|
+
prefix: SubSection<'statsLabels'>;
|
|
68
|
+
postfix: SubSection<'statsLabels'>;
|
|
69
|
+
format: SubSection<'statsLabels'>;
|
|
70
|
+
count: SubSection<'statsLabels'>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
heading: Section<'heading'> & {
|
|
74
|
+
subSectionDefinition: {
|
|
75
|
+
title: SubSection<'title'>;
|
|
76
|
+
subject: SubSection<'subject'>;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
progress_type?: Section<'progressType'>;
|
|
80
|
+
chart_styles?: Section<'chartStyles'> & {
|
|
81
|
+
subSectionDefinition: {
|
|
82
|
+
stacked?: SubSection<'stacked'>;
|
|
83
|
+
legend?: SubSection<'legend'>;
|
|
84
|
+
curve?: SubSection<'curve'>;
|
|
85
|
+
number_format?: SubSection<'numberFormat'>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
format?: Section<'format'> & {
|
|
89
|
+
subSectionDefinition: {
|
|
90
|
+
time?: SubSection<'time'>;
|
|
91
|
+
font_size?: SubSection<'fontSize'>;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
goal_line?: Section<'goalLine'>;
|
|
95
|
+
map_colors?: Section<'mapColors'>;
|
|
96
|
+
prefixes?: Section<'prefixes'>;
|
|
97
|
+
conditional_formatting?: Section<'conditionalFormatting'> & {
|
|
98
|
+
subSectionDefinition?: {
|
|
99
|
+
bar: SubSection<'stacked'>;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export type ComponentNamespace = 'pivot_table' | 'horizontal_bar_chart' | 'bar_chart' | 'area_chart' | 'line_chart' | 'scatter_chart' | 'pie_chart' | 'single_stat' | 'basic_table' | 'combo_chart' | 'mercator_map' | 'custom' | 'fields' | 'progress';
|
|
104
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import Joi from '@vizzly/joi';
|
|
2
2
|
import { Dumpable } from '../Dumpable';
|
|
3
|
-
import { QueryEngineConfig } from '../QueryEngineConfig/types';
|
|
4
3
|
import { DataSet } from '../DataSet/types';
|
|
5
4
|
import { DataPanelConfig } from '../DataPanelConfig/types';
|
|
6
5
|
import { FormatPanelConfig } from '../FormatPanelConfig/types';
|
|
7
6
|
import FieldNotFoundInDataSet from '../errors/FieldNotFoundInDataSet';
|
|
8
7
|
import DataSetNotFound from '../errors/DataSetNotFound';
|
|
9
8
|
import CorruptedView from '../errors/CorruptedView';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { ComponentInterfaceConfig } from './types/ComponentInterfaceConfig';
|
|
10
|
+
import { ComponentNamespace } from './types/namespaces.types';
|
|
11
|
+
export * from './types/ComponentInterfaceConfig';
|
|
13
12
|
export interface ComponentInterface<Hydrated = any, Dumped = any> extends Dumpable<Hydrated, Dumped> {
|
|
14
13
|
title: string;
|
|
15
14
|
description: string;
|
|
16
15
|
servicesClass: string;
|
|
16
|
+
namespace: ComponentNamespace;
|
|
17
17
|
setDataAttributesFromPreAggregatedDataSet?: (attributes: Hydrated, dataSet: DataSet) => Hydrated;
|
|
18
18
|
removeField: (hydrated: Hydrated, fieldId: string) => Hydrated;
|
|
19
19
|
init: (dataSetId: string, overrides?: Partial<Hydrated>) => Hydrated;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StoredTheme } from '../Theme/types';
|
|
2
2
|
import { Dashboard, SaveableDashboardDefinition } from './types';
|
|
3
3
|
import { PartialBy } from '../typeHelpers';
|
|
4
|
+
import { QueryEngineConfig } from '../QueryEngineConfig/types';
|
|
4
5
|
export type RawDefinition = PartialBy<SaveableDashboardDefinition, 'isPlayground' | 'customFields'>;
|
|
5
6
|
export type RawDashboard<Definition = RawDefinition> = {
|
|
6
7
|
id: string;
|
|
@@ -14,4 +15,4 @@ export type RawDashboard<Definition = RawDefinition> = {
|
|
|
14
15
|
metadata?: Dashboard.ExternalMetadata;
|
|
15
16
|
webhook_id: string | null;
|
|
16
17
|
};
|
|
17
|
-
export declare const fromRaw: (rawDashboard: RawDashboard) => Omit<Dashboard, 'dataSets'>;
|
|
18
|
+
export declare const fromRaw: (rawDashboard: RawDashboard, queryEngineConfig: QueryEngineConfig | undefined) => Omit<Dashboard, 'dataSets'>;
|
|
@@ -5,10 +5,11 @@ import { IdentityConfig as IdentityConfigType } from 'shared-logic/src/IdentityC
|
|
|
5
5
|
import { CreateDashboardParams } from '../../api/vizzly/createDashboard';
|
|
6
6
|
import { DashboardPermission as DashboardPermissionType, RawDashboardPermission } from 'shared-logic/src/DashboardPermission/types';
|
|
7
7
|
import { DashboardStorageStrategy } from '../types';
|
|
8
|
+
import { QueryEngineConfig } from '../../QueryEngineConfig/types';
|
|
8
9
|
export declare function prepareCreateResponseForAdding(createdDashboardResponse: {
|
|
9
10
|
dashboard: Dashboard.RawDashboard;
|
|
10
11
|
permissions: RawDashboardPermission[];
|
|
11
|
-
}, dataSets: DataSet[]): {
|
|
12
|
+
}, dataSets: DataSet[], queryEngineConfig: QueryEngineConfig | undefined): {
|
|
12
13
|
createdDashboard: Dashboard.Dashboard;
|
|
13
14
|
formattedPermissions: DashboardPermissionType[];
|
|
14
15
|
};
|
|
@@ -4,13 +4,14 @@ import * as Dashboard from 'shared-logic/src/Dashboard';
|
|
|
4
4
|
import { api } from '../../api';
|
|
5
5
|
import { UnEncryptedDashboardUpdateResponse, UpdateDashboardParams } from '../../api/vizzly/updateDashboard';
|
|
6
6
|
import { DashboardStorageStrategy } from '../types';
|
|
7
|
+
import { QueryEngineConfig } from '../../QueryEngineConfig/types';
|
|
7
8
|
export declare function postUpdateDashboard(dashboardStorageStrategy: DashboardStorageStrategy, vizzlyAPI: ReturnType<typeof api>, updateParams: {
|
|
8
9
|
dashboardSessionToken: string;
|
|
9
10
|
definition?: Dashboard.SaveableDashboardDefinition;
|
|
10
11
|
meta?: any;
|
|
11
12
|
deleted?: boolean;
|
|
12
13
|
}): Promise<UnEncryptedDashboardUpdateResponse>;
|
|
13
|
-
export declare function updateDashboardFromUpdateResponse(updatedDashboardResponse: UnEncryptedDashboardUpdateResponse, dataSets: DataSet[], dashboards: DashboardType[], params: Omit<UpdateDashboardParams, 'dashboardSessionToken'
|
|
14
|
+
export declare function updateDashboardFromUpdateResponse(updatedDashboardResponse: UnEncryptedDashboardUpdateResponse, dataSets: DataSet[], dashboards: DashboardType[], params: Omit<UpdateDashboardParams, 'dashboardSessionToken'>, queryEngineConfig: QueryEngineConfig | undefined): {
|
|
14
15
|
newDashboards: DashboardType[];
|
|
15
16
|
updatedDashboard: DashboardType;
|
|
16
17
|
};
|
|
@@ -9,7 +9,7 @@ export * from './dashboardAPI/creating';
|
|
|
9
9
|
export * from './dashboardAPI/updating';
|
|
10
10
|
export declare function getDashboards<T extends {
|
|
11
11
|
found?: any[];
|
|
12
|
-
}>(dashboardsResponse: T, dataSets: DataSet[]): DashboardType[];
|
|
12
|
+
}>(dashboardsResponse: T, dataSets: DataSet[], queryEngineConfig: QueryEngineConfig | undefined): DashboardType[];
|
|
13
13
|
export declare function fetchDashboards(dashboardStorageStrategy: DashboardStorageStrategy, vizzlyAPI: ReturnType<typeof api>, dashboardAccessTokens: string[], abortController: AbortController): Promise<import("../api/vizzly/multiGetDashboards").Response>;
|
|
14
14
|
export declare const DEFAULT_STRATEGY: DashboardStorageStrategy;
|
|
15
15
|
export declare const getDashboardStorageStrategy: (queryEngineEndpoint: Function | QueryEngineEndpoint | undefined, queryEngineConfig: QueryEngineConfig | undefined) => DashboardStorageStrategy;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { DataSet, FieldFilterOptions } from '../DataSet/types';
|
|
2
2
|
import { QueryAttributes } from '../QueryAttributes/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
3
|
+
import { Section as ConstSection } from '../ComponentInterface/types/namespaces.types';
|
|
4
|
+
export type Section<Type> = ConstSection<Type> & {
|
|
7
5
|
testId?: string;
|
|
6
|
+
namespace?: string;
|
|
8
7
|
};
|
|
9
8
|
type MetricOptions = {
|
|
10
9
|
allowsMultiple?: boolean;
|
|
@@ -28,7 +27,7 @@ export type DimensionSection = Section<'dimension'> & {
|
|
|
28
27
|
filterFieldOptions?: FieldFilterOptions;
|
|
29
28
|
};
|
|
30
29
|
export type LabelledMetricSection = Section<'labelledMetrics'> & {
|
|
31
|
-
|
|
30
|
+
subSection: Array<MetricOptions & {
|
|
32
31
|
title: string;
|
|
33
32
|
}>;
|
|
34
33
|
};
|
|
@@ -11,7 +11,11 @@ import { RawDashboard } from '../Dashboard';
|
|
|
11
11
|
export declare const find: <T extends {
|
|
12
12
|
id: string;
|
|
13
13
|
}>(dataSets: T[], dataSetId: string) => T | null;
|
|
14
|
+
export declare const findByName: <T extends {
|
|
15
|
+
name: string;
|
|
16
|
+
}>(dataSets: T[], dataSetName: string) => T | null;
|
|
14
17
|
export declare const findField: (dataSet: DataSet, id: string) => DataSet.Field;
|
|
18
|
+
export declare const findFieldByName: (dataSet: DataSet, name: string) => DataSet.Field;
|
|
15
19
|
export declare const findDataSet: (dataSets: DataSet[], dataSetId: string) => [DataSet | null, number];
|
|
16
20
|
export declare const upcastDataSet: (rawDataSet: any, queryEngineConfig: QueryEngineConfig) => DataSet;
|
|
17
21
|
export declare const upcastDataSets: (rawDataSet: any[], queryEngineConfig: QueryEngineConfig) => DataSet[];
|
|
@@ -40,3 +44,4 @@ export declare const buildQueryAttributes: (dataSet: DataSet, queryEngineConfig:
|
|
|
40
44
|
export declare const buildDownloadQuery: (dataSet: DataSet, maxCSVDownloadLimit: number, viewFilters: QueryAttributes['filter']) => QueryAttributes;
|
|
41
45
|
export declare const buildViewOnlyQuery: (dataSet: DataSet) => QueryAttributes;
|
|
42
46
|
export declare const addCustomFields: (dataSets: Array<DataSet>, customFields: RawDashboard['definition']['customFields']) => Array<DataSet>;
|
|
47
|
+
export declare const validId: (id: string, dataSet: DataSet[]) => boolean;
|
|
@@ -7,7 +7,7 @@ export declare const insertRow: (display: Display, rowIndex: number, height?: nu
|
|
|
7
7
|
export declare const newEmptyCell: (colSpan: number) => EmptyCell;
|
|
8
8
|
export declare const TOTAL_COLSPAN = 12;
|
|
9
9
|
export declare const appendEmptyCell: (currentPanels: Display, rowIndex: number) => Display;
|
|
10
|
-
export declare const addHeaderRow: (display: Display, rowIndex: number) => Display;
|
|
10
|
+
export declare const addHeaderRow: (display: Display, rowIndex: number, initialTitle: string) => Display;
|
|
11
11
|
export declare const setComponent: (display: Display, component: Component | EmptyCell | HeaderComponent, rowIndex: number, cellIndex: number) => Display;
|
|
12
12
|
type Move = {
|
|
13
13
|
rowIndex: number;
|
|
@@ -16,7 +16,7 @@ type Move = {
|
|
|
16
16
|
export declare const swapComponents: (display: Display, positionA: Move, positionB: Move) => Display;
|
|
17
17
|
export declare const init: () => Display;
|
|
18
18
|
export declare const initRow: (components: Array<Component | EmptyCell | HeaderComponent>, height?: number) => DisplayRow;
|
|
19
|
-
export declare const initHeaderComponent: () => HeaderComponent;
|
|
19
|
+
export declare const initHeaderComponent: (displayTitle: string) => HeaderComponent;
|
|
20
20
|
export declare const listComponentTypesUsed: (display: Display) => ComponentType[];
|
|
21
21
|
export declare const isComponentEmpty: (component: Component | EmptyCell | HeaderComponent) => component is EmptyCell;
|
|
22
22
|
export declare const isHeaderComponent: (component: Component.RawComponent | EmptyCell | HeaderComponent | MaybeOldComponent) => component is HeaderComponent;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DisplayRow, EmptyCell, HeaderComponent } from './types';
|
|
2
2
|
import { Component as ComponentType } from '../Component/types';
|
|
3
|
+
import { ComponentInterfaceConfig } from '../ComponentInterface/types';
|
|
3
4
|
type OldDisplayRow = (ComponentType | null | EmptyCell | HeaderComponent)[];
|
|
4
|
-
export declare const upcastRow: (displayRow: OldDisplayRow | DisplayRow) => DisplayRow;
|
|
5
|
+
export declare const upcastRow: (displayRow: OldDisplayRow | DisplayRow, componentInterfaceConfig?: ComponentInterfaceConfig) => DisplayRow;
|
|
5
6
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { ComponentInterfaceConfig } from './ComponentInterface/types/ComponentInterfaceConfig';
|
|
1
2
|
export interface Dumpable<Hydrated, Dumped> {
|
|
2
3
|
dump: (hydrated: Hydrated) => Dumped;
|
|
3
|
-
load: (dumped: Dumped) => Hydrated;
|
|
4
|
+
load: (dumped: Dumped, componentInterfaceConfig?: ComponentInterfaceConfig) => Hydrated;
|
|
4
5
|
}
|
|
@@ -3,6 +3,7 @@ import { DateTimeField, NonDateTimeField, SupportedAggregateOption } from '../Fi
|
|
|
3
3
|
import { DataType } from './types';
|
|
4
4
|
import { QueryAttributes, SupportedOperators } from '../QueryAttributes/types';
|
|
5
5
|
import * as Aggregate from '../Aggregate';
|
|
6
|
+
import { SupportedAggregates } from '../Aggregate';
|
|
6
7
|
import { SupportedTimeTruncFunctions } from '../TimeDimension/types';
|
|
7
8
|
import { QueryEngineConfig } from '../QueryEngineConfig/types';
|
|
8
9
|
import { SupportedTransformationFunctions } from '../Functions/types';
|
|
@@ -21,7 +22,9 @@ export type OldField = {
|
|
|
21
22
|
}>;
|
|
22
23
|
supportedAggregateOptions?: string[];
|
|
23
24
|
};
|
|
24
|
-
export declare const upcastField: (maybeOldField: OldField, queryEngineConfig: QueryEngineConfig
|
|
25
|
+
export declare const upcastField: (maybeOldField: OldField, queryEngineConfig: QueryEngineConfig, options?: {
|
|
26
|
+
allowEmptyPublicName: boolean;
|
|
27
|
+
}) => DateTimeField | NonDateTimeField;
|
|
25
28
|
export declare const valueIsOrDataType: (value: unknown, dataType: DataType) => boolean;
|
|
26
29
|
export declare const parseValue: (raw: string | number | null | boolean | Date | string[], type: DataType) => string | number | boolean | Date | null;
|
|
27
30
|
export declare const parseBooleanFromString: (raw: string, type: DataType) => string | boolean;
|
|
@@ -80,9 +83,9 @@ export declare const getQueryFieldIdFromResultFieldId: (fieldIdOrDatumKey: strin
|
|
|
80
83
|
fieldId: string;
|
|
81
84
|
function: QueryAttributes.Aggregate;
|
|
82
85
|
};
|
|
83
|
-
export declare
|
|
86
|
+
export declare const listValidFunctionsForDataType: (field: {
|
|
84
87
|
dataType: DataType;
|
|
85
|
-
}, supportedTransformationFunctions: SupportedTransformationFunctions
|
|
88
|
+
}, supportedTransformationFunctions: SupportedTransformationFunctions | SupportedAggregates) => string[];
|
|
86
89
|
export declare const removeField: <T extends {
|
|
87
90
|
id: string;
|
|
88
91
|
}>(originalFields: T[], removeFields: (QueryAttributes.Dimension | QueryAttributes.Measure)[]) => T[];
|
|
@@ -2,10 +2,11 @@ import { DataType } from '../Field/types';
|
|
|
2
2
|
import { QueryAttributes, SupportedOperators } from './types';
|
|
3
3
|
import { QueryEngineConfig } from '../QueryEngineConfig/types';
|
|
4
4
|
import { ApproxAxisLabelCount, Component } from '../Component/types';
|
|
5
|
+
import { TextOverride } from '../Translations/types';
|
|
5
6
|
export declare const validOperatorsForField: (field: {
|
|
6
7
|
dataType: DataType;
|
|
7
8
|
}, queryEngineConfig: QueryEngineConfig) => string[];
|
|
8
|
-
export declare const aggregateName: (func: QueryAttributes.Aggregate) => string;
|
|
9
|
+
export declare const aggregateName: (func: QueryAttributes.Aggregate, textOverride: TextOverride) => string;
|
|
9
10
|
declare const vizzlyManagedOperators: SupportedOperators;
|
|
10
11
|
export declare const supportedOperators: (keys?: Array<string>) => SupportedOperators;
|
|
11
12
|
export declare const operatorToString: (operator: QueryAttributes.Operator) => string;
|