@visactor/vbi 0.4.19 → 0.4.21

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.
Files changed (52) hide show
  1. package/dist/builder/adapters/vquery-vseed/build-vquery.d.ts +2 -2
  2. package/dist/builder/adapters/vquery-vseed/build-vseed.d.ts +2 -2
  3. package/dist/builder/adapters/vquery-vseed/index.d.ts +3 -3
  4. package/dist/builder/builder.d.ts +6 -6
  5. package/dist/builder/features/chart-type/chart-type-builder.d.ts +20 -1
  6. package/dist/builder/features/chart-type/dimension-encoding.d.ts +4 -0
  7. package/dist/builder/features/chart-type/measure-encoding.d.ts +4 -0
  8. package/dist/builder/features/chart-type/reapply-dimension-encodings.d.ts +2 -0
  9. package/dist/builder/features/chart-type/reapply-measure-encodings.d.ts +2 -0
  10. package/dist/builder/features/dimensions/dim-builder.d.ts +3 -2
  11. package/dist/builder/features/dimensions/dim-node-builder.d.ts +32 -1
  12. package/dist/builder/features/havingFilter/having-builder.d.ts +2 -2
  13. package/dist/builder/features/measures/mea-builder.d.ts +3 -2
  14. package/dist/builder/features/measures/mea-node-builder.d.ts +33 -3
  15. package/dist/builder/features/whereFilter/where-builder.d.ts +2 -2
  16. package/dist/builder/features/whereFilter/where-node-builder.d.ts +11 -2
  17. package/dist/builder/index.d.ts +1 -1
  18. package/dist/builder/modules/build.d.ts +2 -2
  19. package/dist/builder/modules/index.d.ts +2 -2
  20. package/dist/builder/modules/is-empty.d.ts +1 -1
  21. package/dist/index.cjs +1497 -387
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +1489 -379
  24. package/dist/pipeline/vqueryDSL/aggregateMap.d.ts +23 -3
  25. package/dist/pipeline/vqueryDSL/buildOrderBy.d.ts +2 -0
  26. package/dist/pipeline/vqueryDSL/index.d.ts +2 -2
  27. package/dist/pipeline/vqueryDSL/resolveDatePredicate.d.ts +7 -0
  28. package/dist/pipeline/vqueryDSL/types.d.ts +6 -5
  29. package/dist/types/builder/VBIInterface.d.ts +5 -4
  30. package/dist/types/builder/adapter.d.ts +15 -13
  31. package/dist/types/builder/build-vseed.d.ts +3 -0
  32. package/dist/types/builder/context.d.ts +2 -2
  33. package/dist/types/builder/index.d.ts +4 -3
  34. package/dist/types/builder/observe.d.ts +2 -1
  35. package/dist/types/connector/query.d.ts +1 -0
  36. package/dist/types/dsl/dimensions/aggregate.d.ts +15 -0
  37. package/dist/types/dsl/dimensions/dimensions.d.ts +62 -0
  38. package/dist/types/dsl/encoding.d.ts +2 -2
  39. package/dist/types/dsl/havingFilter/having.d.ts +3 -3
  40. package/dist/types/dsl/index.d.ts +5 -3
  41. package/dist/types/dsl/measures/measures.d.ts +151 -4
  42. package/dist/types/dsl/sort.d.ts +13 -0
  43. package/dist/types/dsl/vbi/vbi.d.ts +90 -5
  44. package/dist/types/dsl/whereFilter/date.d.ts +95 -0
  45. package/dist/types/dsl/whereFilter/filters.d.ts +142 -5
  46. package/dist/utils/filter-guards.d.ts +2 -2
  47. package/dist/vbi/create-vbi.d.ts +6 -7
  48. package/dist/vbi/from/from-vbi-dsl-input.d.ts +3 -3
  49. package/dist/vbi/from/set-base-dsl-fields.d.ts +2 -2
  50. package/dist/vbi/generate-empty-dsl.d.ts +2 -2
  51. package/dist/vbi/normalize/types.d.ts +3 -3
  52. package/package.json +5 -5
@@ -1,9 +1,11 @@
1
- export type VQueryAggregateFunc = 'count' | 'count_distinct' | 'sum' | 'avg' | 'min' | 'max' | 'variance' | 'variance_pop' | 'stddev' | 'median' | 'quantile';
1
+ export type VQueryBaseAggregateFunc = 'count' | 'count_distinct' | 'sum' | 'avg' | 'min' | 'max' | 'variance' | 'variance_pop' | 'stddev' | 'median' | 'quantile';
2
+ export type VQueryDateAggregateFunc = 'to_year' | 'to_quarter' | 'to_month' | 'to_week' | 'to_day' | 'to_hour' | 'to_minute' | 'to_second';
3
+ export type VQueryAggregateFunc = VQueryBaseAggregateFunc | VQueryDateAggregateFunc;
2
4
  export type VQueryAggregate = {
3
5
  func: VQueryAggregateFunc;
4
6
  quantile?: number;
5
7
  };
6
- export type VBIAggregateInput = {
8
+ export type VBIMeasureAggregateInput = {
7
9
  func: 'count';
8
10
  } | {
9
11
  func: 'countDistinct';
@@ -27,4 +29,22 @@ export type VBIAggregateInput = {
27
29
  func: 'quantile';
28
30
  quantile?: number;
29
31
  };
30
- export declare const mapAggregateForVQuery: (aggregate: VBIAggregateInput | undefined) => VQueryAggregate | undefined;
32
+ export type VBIDimensionAggregateInput = {
33
+ func: 'toYear';
34
+ } | {
35
+ func: 'toQuarter';
36
+ } | {
37
+ func: 'toMonth';
38
+ } | {
39
+ func: 'toWeek';
40
+ } | {
41
+ func: 'toDay';
42
+ } | {
43
+ func: 'toHour';
44
+ } | {
45
+ func: 'toMinute';
46
+ } | {
47
+ func: 'toSecond';
48
+ };
49
+ export declare const mapAggregateForVQuery: (aggregate: VBIMeasureAggregateInput | undefined) => VQueryAggregate | undefined;
50
+ export declare const mapDimensionAggregateForVQuery: (aggregate: VBIDimensionAggregateInput | undefined) => VQueryAggregate | undefined;
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildOrderBy: buildPipe;
@@ -1,3 +1,3 @@
1
1
  import type { VQueryDSL } from '@visactor/vquery';
2
- import type { VBIBuilderInterface, VBIDSL } from '../../types';
3
- export declare const buildVQuery: (vbiDSL: VBIDSL, builder: VBIBuilderInterface<any, any>) => VQueryDSL;
2
+ import type { VBIChartBuilderInterface, VBIChartDSL } from '../../types';
3
+ export declare const buildVQuery: (vbiDSL: VBIChartDSL, builder: VBIChartBuilderInterface<any, any>) => VQueryDSL;
@@ -0,0 +1,7 @@
1
+ import type { VBIWhereDateBounds, VBIWhereDatePredicate } from '../../types';
2
+ export type DateRange = {
3
+ start: string;
4
+ end: string;
5
+ bounds: VBIWhereDateBounds;
6
+ };
7
+ export declare function resolveDatePredicate(predicate: VBIWhereDatePredicate, now?: Date): DateRange;
@@ -1,6 +1,7 @@
1
1
  import type { VQueryDSL } from '@visactor/vquery';
2
- import type { VBIBuilderInterface, VBIDSL } from '../../types';
3
- export type buildPipe = (queryDSL: VQueryDSL, context: {
4
- vbiDSL: VBIDSL;
5
- builder: VBIBuilderInterface<any, any>;
6
- }) => VQueryDSL;
2
+ import type { VBIChartBuilderInterface, VBIChartDSL } from '../../types';
3
+ export type buildPipeContext = {
4
+ vbiDSL: VBIChartDSL;
5
+ builder: VBIChartBuilderInterface<any, any>;
6
+ };
7
+ export type buildPipe = (queryDSL: VQueryDSL, context: buildPipeContext) => VQueryDSL;
@@ -1,8 +1,9 @@
1
1
  import type { DefaultVBIQueryDSL, DefaultVBISeedDSL } from '../../builder/adapters/vquery-vseed/types';
2
- import type { VBIDSL } from '../dsl';
2
+ import type { VBIChartDSL } from '../dsl';
3
+ import type { BuildVSeedOptions } from './build-vseed';
3
4
  import type { MeasuresBuilder, DimensionsBuilder, ChartTypeBuilder, HavingFilterBuilder, WhereFilterBuilder, ThemeBuilder, LocaleBuilder, LimitBuilder, UndoManager } from '../../builder/features';
4
5
  import type { Map, Doc } from 'yjs';
5
- export interface VBIBuilderInterface<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
6
+ export interface VBIChartBuilderInterface<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
6
7
  doc: Doc;
7
8
  dsl: Map<any>;
8
9
  undoManager: UndoManager;
@@ -16,8 +17,8 @@ export interface VBIBuilderInterface<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL =
16
17
  limit: LimitBuilder;
17
18
  applyUpdate: (update: Uint8Array, origin?: any) => void;
18
19
  encodeStateAsUpdate: (targetStateVector?: Uint8Array) => Uint8Array;
19
- buildVSeed: () => Promise<TSeedDSL>;
20
+ buildVSeed: (options?: BuildVSeedOptions) => Promise<TSeedDSL>;
20
21
  buildVQuery: () => TQueryDSL;
21
- build: () => VBIDSL;
22
+ build: () => VBIChartDSL;
22
23
  isEmpty: () => boolean;
23
24
  }
@@ -1,21 +1,23 @@
1
1
  import type { DefaultVBIQueryDSL, DefaultVBISeedDSL } from '../../builder/adapters/vquery-vseed/types';
2
2
  import type { Map } from 'yjs';
3
- import type { VBIDSL } from '../dsl';
4
- import type { VBIBuilderInterface } from './VBIInterface';
5
- export interface VBIBuildVQueryContext<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
3
+ import type { VBIChartDSL } from '../dsl';
4
+ import type { BuildVSeedOptions } from './build-vseed';
5
+ import type { VBIChartBuilderInterface } from './VBIInterface';
6
+ export interface VBIChartBuildVQueryContext<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
6
7
  dsl: Map<any>;
7
- vbiDSL: VBIDSL;
8
- builder: VBIBuilderInterface<TQueryDSL, TSeedDSL>;
8
+ vbiDSL: VBIChartDSL;
9
+ builder: VBIChartBuilderInterface<TQueryDSL, TSeedDSL>;
9
10
  }
10
- export interface VBIBuildVSeedContext<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> extends VBIBuildVQueryContext<TQueryDSL, TSeedDSL> {
11
+ export interface VBIChartBuildVSeedContext<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> extends VBIChartBuildVQueryContext<TQueryDSL, TSeedDSL> {
12
+ options: BuildVSeedOptions;
11
13
  queryDSL: TQueryDSL;
12
14
  }
13
- export type VBIQueryBuilder<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> = (context: VBIBuildVQueryContext<TQueryDSL, TSeedDSL>) => TQueryDSL;
14
- export type VBISeedBuilder<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> = (context: VBIBuildVSeedContext<TQueryDSL, TSeedDSL>) => Promise<TSeedDSL> | TSeedDSL;
15
- export interface VBIBuilderAdapters<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
16
- buildVQuery: VBIQueryBuilder<TQueryDSL, TSeedDSL>;
17
- buildVSeed: VBISeedBuilder<TQueryDSL, TSeedDSL>;
15
+ export type VBIChartQueryBuilder<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> = (context: VBIChartBuildVQueryContext<TQueryDSL, TSeedDSL>) => TQueryDSL;
16
+ export type VBIChartSeedBuilder<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> = (context: VBIChartBuildVSeedContext<TQueryDSL, TSeedDSL>) => Promise<TSeedDSL> | TSeedDSL;
17
+ export interface VBIChartBuilderAdapters<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
18
+ buildVQuery: VBIChartQueryBuilder<TQueryDSL, TSeedDSL>;
19
+ buildVSeed: VBIChartSeedBuilder<TQueryDSL, TSeedDSL>;
18
20
  }
19
- export interface VBIBuilderOptions<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
20
- adapters?: Partial<VBIBuilderAdapters<TQueryDSL, TSeedDSL>>;
21
+ export interface VBIChartBuilderOptions<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
22
+ adapters?: Partial<VBIChartBuilderAdapters<TQueryDSL, TSeedDSL>>;
21
23
  }
@@ -0,0 +1,3 @@
1
+ export interface BuildVSeedOptions {
2
+ signal?: AbortSignal;
3
+ }
@@ -1,4 +1,4 @@
1
- import { VBIDSL } from '../dsl';
1
+ import { VBIChartDSL } from '../dsl';
2
2
  export interface BuilderContext {
3
- getVBIDSL(): VBIDSL;
3
+ getVBIChartDSL(): VBIChartDSL;
4
4
  }
@@ -1,3 +1,4 @@
1
- export type { VBIBuilderInterface } from './VBIInterface';
2
- export type { VBIBuildVQueryContext, VBIBuildVSeedContext, VBIQueryBuilder, VBISeedBuilder, VBIBuilderAdapters, VBIBuilderOptions, } from './adapter';
3
- export type { ObserveCallback } from './observe';
1
+ export type { BuildVSeedOptions } from './build-vseed';
2
+ export type { VBIChartBuilderInterface } from './VBIInterface';
3
+ export type { VBIChartBuildVQueryContext, VBIChartBuildVSeedContext, VBIChartQueryBuilder, VBIChartSeedBuilder, VBIChartBuilderAdapters, VBIChartBuilderOptions, } from './adapter';
4
+ export type { ObserveCallback, ObserveDeepCallback } from './observe';
@@ -1,2 +1,3 @@
1
- import { YMapEvent, Transaction } from 'yjs';
1
+ import type { YEvent, YMapEvent, Transaction } from 'yjs';
2
2
  export type ObserveCallback = (e: YMapEvent<any>, trans: Transaction) => void;
3
+ export type ObserveDeepCallback = (events: YEvent<any>[], trans: Transaction) => void;
@@ -11,5 +11,6 @@ export declare const zVBIQueryProps: z.ZodObject<{
11
11
  type: z.ZodString;
12
12
  }, z.core.$strip>>;
13
13
  connectorId: z.ZodString;
14
+ signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
14
15
  }, z.core.$strip>;
15
16
  export type VBIQueryProps = z.infer<typeof zVBIQueryProps>;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const VBI_DIMENSION_DATE_AGGREGATE_FUNCS: readonly ["toYear", "toQuarter", "toMonth", "toWeek", "toDay", "toHour", "toMinute", "toSecond"];
3
+ export declare const zDimensionAggregate: z.ZodObject<{
4
+ func: z.ZodEnum<{
5
+ toYear: "toYear";
6
+ toQuarter: "toQuarter";
7
+ toMonth: "toMonth";
8
+ toWeek: "toWeek";
9
+ toDay: "toDay";
10
+ toHour: "toHour";
11
+ toMinute: "toMinute";
12
+ toSecond: "toSecond";
13
+ }>;
14
+ }, z.core.$strip>;
15
+ export type VBIDimensionAggregate = z.infer<typeof zDimensionAggregate>;
@@ -3,12 +3,74 @@ export declare const zVBIDimensionSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  field: z.ZodString;
5
5
  alias: z.ZodString;
6
+ encoding: z.ZodOptional<z.ZodEnum<{
7
+ column: "column";
8
+ xAxis: "xAxis";
9
+ yAxis: "yAxis";
10
+ angle: "angle";
11
+ color: "color";
12
+ detail: "detail";
13
+ tooltip: "tooltip";
14
+ label: "label";
15
+ row: "row";
16
+ player: "player";
17
+ hierarchy: "hierarchy";
18
+ }>>;
19
+ aggregate: z.ZodOptional<z.ZodObject<{
20
+ func: z.ZodEnum<{
21
+ toYear: "toYear";
22
+ toQuarter: "toQuarter";
23
+ toMonth: "toMonth";
24
+ toWeek: "toWeek";
25
+ toDay: "toDay";
26
+ toHour: "toHour";
27
+ toMinute: "toMinute";
28
+ toSecond: "toSecond";
29
+ }>;
30
+ }, z.core.$strip>>;
31
+ sort: z.ZodOptional<z.ZodObject<{
32
+ order: z.ZodEnum<{
33
+ asc: "asc";
34
+ desc: "desc";
35
+ }>;
36
+ }, z.core.$strip>>;
6
37
  }, z.core.$strip>;
7
38
  export declare const zVBIDimensionGroupSchema: z.ZodType<VBIDimensionGroup>;
8
39
  export declare const zVBIDimensionTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
9
40
  id: z.ZodString;
10
41
  field: z.ZodString;
11
42
  alias: z.ZodString;
43
+ encoding: z.ZodOptional<z.ZodEnum<{
44
+ column: "column";
45
+ xAxis: "xAxis";
46
+ yAxis: "yAxis";
47
+ angle: "angle";
48
+ color: "color";
49
+ detail: "detail";
50
+ tooltip: "tooltip";
51
+ label: "label";
52
+ row: "row";
53
+ player: "player";
54
+ hierarchy: "hierarchy";
55
+ }>>;
56
+ aggregate: z.ZodOptional<z.ZodObject<{
57
+ func: z.ZodEnum<{
58
+ toYear: "toYear";
59
+ toQuarter: "toQuarter";
60
+ toMonth: "toMonth";
61
+ toWeek: "toWeek";
62
+ toDay: "toDay";
63
+ toHour: "toHour";
64
+ toMinute: "toMinute";
65
+ toSecond: "toSecond";
66
+ }>;
67
+ }, z.core.$strip>>;
68
+ sort: z.ZodOptional<z.ZodObject<{
69
+ order: z.ZodEnum<{
70
+ asc: "asc";
71
+ desc: "desc";
72
+ }>;
73
+ }, z.core.$strip>>;
12
74
  }, z.core.$strip>, z.ZodType<VBIDimensionGroup, unknown, z.core.$ZodTypeInternals<VBIDimensionGroup, unknown>>]>>;
13
75
  export type VBIDimension = z.infer<typeof zVBIDimensionSchema>;
14
76
  export type VBIDimensionGroup = {
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  export declare const VBI_SUPPORTED_ENCODINGS: readonly ["yAxis", "xAxis", "color", "label", "tooltip", "size"];
3
3
  export declare const zVBIEncoding: z.ZodEnum<{
4
- yAxis: "yAxis";
5
4
  xAxis: "xAxis";
5
+ yAxis: "yAxis";
6
6
  color: "color";
7
- label: "label";
8
7
  tooltip: "tooltip";
8
+ label: "label";
9
9
  size: "size";
10
10
  }>;
11
11
  export type VBIEncoding = z.infer<typeof zVBIEncoding>;
@@ -8,7 +8,7 @@ export type VBIHavingAggregate = z.infer<typeof zAggregate>;
8
8
  export declare const zVBIHavingFilter: z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  field: z.ZodString;
11
- aggregate: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
12
  func: z.ZodEnum<{
13
13
  count: "count";
14
14
  countDistinct: "countDistinct";
@@ -24,8 +24,8 @@ export declare const zVBIHavingFilter: z.ZodObject<{
24
24
  }, z.core.$strip>, z.ZodObject<{
25
25
  func: z.ZodLiteral<"quantile">;
26
26
  quantile: z.ZodOptional<z.ZodNumber>;
27
- }, z.core.$strip>], "func">>;
28
- op: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>], "func">;
28
+ op: z.ZodString;
29
29
  value: z.ZodOptional<z.ZodAny>;
30
30
  }, z.core.$strip>;
31
31
  export type VBIHavingFilter = z.infer<typeof zVBIHavingFilter>;
@@ -1,7 +1,9 @@
1
+ export type { VBISort, VBISortOrder } from './sort';
1
2
  export type { VBIDimensionTree, VBIDimensionGroup, VBIDimension } from './dimensions/dimensions';
2
- export type { VBIMeasureTree, VBIMeasureGroup, VBIMeasure } from './measures/measures';
3
- export type { VBIFilter, VBIWhereGroup, VBIWhereClause } from './whereFilter/filters';
3
+ export type { VBIDimensionAggregate } from './dimensions/aggregate';
4
+ export type { VBIMeasureTree, VBIMeasureGroup, VBIMeasure, VBIMeasureFormat } from './measures/measures';
5
+ export type { VBIWhereDateInput, VBIWhereDateUnit, VBIWhereDateBounds, VBIWhereDatePeriod, VBIWhereDatePredicate, VBIWhereFilter, VBIWhereScalarFilter, VBIWhereDateFilter, VBIWhereGroup, VBIWhereClause, } from './whereFilter/filters';
4
6
  export type { VBIHavingFilter, VBIHavingGroup, VBIHavingClause, VBIHavingAggregate } from './havingFilter/having';
5
7
  export type { VBIDSLTheme } from './theme/theme';
6
8
  export type { VBIDSLLocale } from './locale/locale';
7
- export type { VBIDSL, VBIDSLInput } from './vbi/vbi';
9
+ export type { VBIChartDSL, VBIChartDSLInput } from './vbi/vbi';
@@ -1,15 +1,69 @@
1
1
  import { z } from 'zod';
2
+ import type { NumFormat } from '@visactor/vseed';
3
+ export declare const zVBIMeasureFormat: z.ZodUnion<readonly [z.ZodObject<{
4
+ autoFormat: z.ZodLiteral<true>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
7
+ number: "number";
8
+ percent: "percent";
9
+ permille: "permille";
10
+ scientific: "scientific";
11
+ }>>>;
12
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
13
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
14
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
15
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
16
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
17
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
18
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
19
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
20
+ morePrecision: "morePrecision";
21
+ lessPrecision: "lessPrecision";
22
+ }>>>;
23
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
24
+ floor: "floor";
25
+ ceil: "ceil";
26
+ expand: "expand";
27
+ trunc: "trunc";
28
+ halfCeil: "halfCeil";
29
+ halfFloor: "halfFloor";
30
+ halfExpand: "halfExpand";
31
+ halfTrunc: "halfTrunc";
32
+ halfEven: "halfEven";
33
+ }>>>;
34
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
35
+ }, z.core.$strip>]>;
36
+ export type VBIMeasureFormat = {
37
+ autoFormat: true;
38
+ } | ({
39
+ autoFormat?: false;
40
+ } & NumFormat);
2
41
  export declare const zVBIMeasure: z.ZodObject<{
3
42
  id: z.ZodString;
4
43
  field: z.ZodString;
5
44
  alias: z.ZodString;
6
45
  encoding: z.ZodEnum<{
7
- yAxis: "yAxis";
46
+ value: "value";
47
+ column: "column";
8
48
  xAxis: "xAxis";
49
+ yAxis: "yAxis";
50
+ angle: "angle";
9
51
  color: "color";
10
- label: "label";
52
+ detail: "detail";
11
53
  tooltip: "tooltip";
54
+ label: "label";
55
+ min: "min";
56
+ max: "max";
57
+ median: "median";
58
+ primaryYAxis: "primaryYAxis";
59
+ secondaryYAxis: "secondaryYAxis";
60
+ radius: "radius";
12
61
  size: "size";
62
+ q1: "q1";
63
+ q3: "q3";
64
+ outliers: "outliers";
65
+ x0: "x0";
66
+ x1: "x1";
13
67
  }>;
14
68
  aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
15
69
  func: z.ZodEnum<{
@@ -28,6 +82,45 @@ export declare const zVBIMeasure: z.ZodObject<{
28
82
  func: z.ZodLiteral<"quantile">;
29
83
  quantile: z.ZodOptional<z.ZodNumber>;
30
84
  }, z.core.$strip>], "func">;
85
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
86
+ autoFormat: z.ZodLiteral<true>;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
89
+ number: "number";
90
+ percent: "percent";
91
+ permille: "permille";
92
+ scientific: "scientific";
93
+ }>>>;
94
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
95
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
96
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
97
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
98
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
99
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
100
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
101
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
102
+ morePrecision: "morePrecision";
103
+ lessPrecision: "lessPrecision";
104
+ }>>>;
105
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
106
+ floor: "floor";
107
+ ceil: "ceil";
108
+ expand: "expand";
109
+ trunc: "trunc";
110
+ halfCeil: "halfCeil";
111
+ halfFloor: "halfFloor";
112
+ halfExpand: "halfExpand";
113
+ halfTrunc: "halfTrunc";
114
+ halfEven: "halfEven";
115
+ }>>>;
116
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
117
+ }, z.core.$strip>]>>;
118
+ sort: z.ZodOptional<z.ZodObject<{
119
+ order: z.ZodEnum<{
120
+ asc: "asc";
121
+ desc: "desc";
122
+ }>;
123
+ }, z.core.$strip>>;
31
124
  }, z.core.$strip>;
32
125
  export declare const zVBIMeasureGroup: z.ZodType<VBIMeasureGroup>;
33
126
  export declare const zVBIMeasureTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -35,12 +128,27 @@ export declare const zVBIMeasureTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObjec
35
128
  field: z.ZodString;
36
129
  alias: z.ZodString;
37
130
  encoding: z.ZodEnum<{
38
- yAxis: "yAxis";
131
+ value: "value";
132
+ column: "column";
39
133
  xAxis: "xAxis";
134
+ yAxis: "yAxis";
135
+ angle: "angle";
40
136
  color: "color";
41
- label: "label";
137
+ detail: "detail";
42
138
  tooltip: "tooltip";
139
+ label: "label";
140
+ min: "min";
141
+ max: "max";
142
+ median: "median";
143
+ primaryYAxis: "primaryYAxis";
144
+ secondaryYAxis: "secondaryYAxis";
145
+ radius: "radius";
43
146
  size: "size";
147
+ q1: "q1";
148
+ q3: "q3";
149
+ outliers: "outliers";
150
+ x0: "x0";
151
+ x1: "x1";
44
152
  }>;
45
153
  aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
154
  func: z.ZodEnum<{
@@ -59,6 +167,45 @@ export declare const zVBIMeasureTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObjec
59
167
  func: z.ZodLiteral<"quantile">;
60
168
  quantile: z.ZodOptional<z.ZodNumber>;
61
169
  }, z.core.$strip>], "func">;
170
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
171
+ autoFormat: z.ZodLiteral<true>;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
174
+ number: "number";
175
+ percent: "percent";
176
+ permille: "permille";
177
+ scientific: "scientific";
178
+ }>>>;
179
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
180
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
181
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
182
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
183
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
184
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
185
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
186
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
187
+ morePrecision: "morePrecision";
188
+ lessPrecision: "lessPrecision";
189
+ }>>>;
190
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
191
+ floor: "floor";
192
+ ceil: "ceil";
193
+ expand: "expand";
194
+ trunc: "trunc";
195
+ halfCeil: "halfCeil";
196
+ halfFloor: "halfFloor";
197
+ halfExpand: "halfExpand";
198
+ halfTrunc: "halfTrunc";
199
+ halfEven: "halfEven";
200
+ }>>>;
201
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
202
+ }, z.core.$strip>]>>;
203
+ sort: z.ZodOptional<z.ZodObject<{
204
+ order: z.ZodEnum<{
205
+ asc: "asc";
206
+ desc: "desc";
207
+ }>;
208
+ }, z.core.$strip>>;
62
209
  }, z.core.$strip>, z.ZodType<VBIMeasureGroup, unknown, z.core.$ZodTypeInternals<VBIMeasureGroup, unknown>>]>>;
63
210
  export type VBIMeasure = z.infer<typeof zVBIMeasure>;
64
211
  export type VBIMeasureGroup = {
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const zVBISortOrder: z.ZodEnum<{
3
+ asc: "asc";
4
+ desc: "desc";
5
+ }>;
6
+ export declare const zVBISort: z.ZodObject<{
7
+ order: z.ZodEnum<{
8
+ asc: "asc";
9
+ desc: "desc";
10
+ }>;
11
+ }, z.core.$strip>;
12
+ export type VBISortOrder = z.infer<typeof zVBISortOrder>;
13
+ export type VBISort = z.infer<typeof zVBISort>;
@@ -1,23 +1,69 @@
1
1
  import { z } from 'zod';
2
- export declare const zVBIDSL: z.ZodObject<{
2
+ export declare const zVBIChartDSL: z.ZodObject<{
3
3
  connectorId: z.ZodString;
4
4
  chartType: z.ZodCustom<any, any>;
5
5
  dimensions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  field: z.ZodString;
8
8
  alias: z.ZodString;
9
+ encoding: z.ZodOptional<z.ZodEnum<{
10
+ column: "column";
11
+ xAxis: "xAxis";
12
+ yAxis: "yAxis";
13
+ angle: "angle";
14
+ color: "color";
15
+ detail: "detail";
16
+ tooltip: "tooltip";
17
+ label: "label";
18
+ row: "row";
19
+ player: "player";
20
+ hierarchy: "hierarchy";
21
+ }>>;
22
+ aggregate: z.ZodOptional<z.ZodObject<{
23
+ func: z.ZodEnum<{
24
+ toYear: "toYear";
25
+ toQuarter: "toQuarter";
26
+ toMonth: "toMonth";
27
+ toWeek: "toWeek";
28
+ toDay: "toDay";
29
+ toHour: "toHour";
30
+ toMinute: "toMinute";
31
+ toSecond: "toSecond";
32
+ }>;
33
+ }, z.core.$strip>>;
34
+ sort: z.ZodOptional<z.ZodObject<{
35
+ order: z.ZodEnum<{
36
+ asc: "asc";
37
+ desc: "desc";
38
+ }>;
39
+ }, z.core.$strip>>;
9
40
  }, z.core.$strip>, z.ZodType<import("..").VBIDimensionGroup, unknown, z.core.$ZodTypeInternals<import("..").VBIDimensionGroup, unknown>>]>>;
10
41
  measures: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
11
42
  id: z.ZodString;
12
43
  field: z.ZodString;
13
44
  alias: z.ZodString;
14
45
  encoding: z.ZodEnum<{
15
- yAxis: "yAxis";
46
+ value: "value";
47
+ column: "column";
16
48
  xAxis: "xAxis";
49
+ yAxis: "yAxis";
50
+ angle: "angle";
17
51
  color: "color";
18
- label: "label";
52
+ detail: "detail";
19
53
  tooltip: "tooltip";
54
+ label: "label";
55
+ min: "min";
56
+ max: "max";
57
+ median: "median";
58
+ primaryYAxis: "primaryYAxis";
59
+ secondaryYAxis: "secondaryYAxis";
60
+ radius: "radius";
20
61
  size: "size";
62
+ q1: "q1";
63
+ q3: "q3";
64
+ outliers: "outliers";
65
+ x0: "x0";
66
+ x1: "x1";
21
67
  }>;
22
68
  aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
23
69
  func: z.ZodEnum<{
@@ -36,6 +82,45 @@ export declare const zVBIDSL: z.ZodObject<{
36
82
  func: z.ZodLiteral<"quantile">;
37
83
  quantile: z.ZodOptional<z.ZodNumber>;
38
84
  }, z.core.$strip>], "func">;
85
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
86
+ autoFormat: z.ZodLiteral<true>;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
89
+ number: "number";
90
+ percent: "percent";
91
+ permille: "permille";
92
+ scientific: "scientific";
93
+ }>>>;
94
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
95
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
96
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
97
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
98
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
99
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
100
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
101
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
102
+ morePrecision: "morePrecision";
103
+ lessPrecision: "lessPrecision";
104
+ }>>>;
105
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
106
+ floor: "floor";
107
+ ceil: "ceil";
108
+ expand: "expand";
109
+ trunc: "trunc";
110
+ halfCeil: "halfCeil";
111
+ halfFloor: "halfFloor";
112
+ halfExpand: "halfExpand";
113
+ halfTrunc: "halfTrunc";
114
+ halfEven: "halfEven";
115
+ }>>>;
116
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
117
+ }, z.core.$strip>]>>;
118
+ sort: z.ZodOptional<z.ZodObject<{
119
+ order: z.ZodEnum<{
120
+ asc: "asc";
121
+ desc: "desc";
122
+ }>;
123
+ }, z.core.$strip>>;
39
124
  }, z.core.$strip>, z.ZodType<import("..").VBIMeasureGroup, unknown, z.core.$ZodTypeInternals<import("..").VBIMeasureGroup, unknown>>]>>;
40
125
  havingFilter: z.ZodDefault<z.ZodOptional<z.ZodType<{
41
126
  id: string;
@@ -78,5 +163,5 @@ export declare const zVBIDSL: z.ZodObject<{
78
163
  limit: z.ZodOptional<z.ZodNumber>;
79
164
  version: z.ZodNumber;
80
165
  }, z.core.$strip>;
81
- export type VBIDSLInput = z.input<typeof zVBIDSL>;
82
- export type VBIDSL = z.output<typeof zVBIDSL>;
166
+ export type VBIChartDSLInput = z.input<typeof zVBIChartDSL>;
167
+ export type VBIChartDSL = z.output<typeof zVBIChartDSL>;