@visactor/vbi 0.4.17 → 0.4.20

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 (60) hide show
  1. package/dist/builder/adapters/index.d.ts +1 -0
  2. package/dist/builder/adapters/vquery-vseed/build-vquery.d.ts +3 -0
  3. package/dist/builder/adapters/vquery-vseed/build-vseed.d.ts +3 -0
  4. package/dist/builder/adapters/vquery-vseed/index.d.ts +7 -0
  5. package/dist/builder/adapters/vquery-vseed/types.d.ts +4 -0
  6. package/dist/builder/{vbi-builder.d.ts → builder.d.ts} +8 -8
  7. package/dist/builder/features/chart-type/chart-type-builder.d.ts +20 -1
  8. package/dist/builder/features/chart-type/dimension-encoding.d.ts +4 -0
  9. package/dist/builder/features/chart-type/measure-encoding.d.ts +4 -0
  10. package/dist/builder/features/chart-type/reapply-dimension-encodings.d.ts +2 -0
  11. package/dist/builder/features/chart-type/reapply-measure-encodings.d.ts +2 -0
  12. package/dist/builder/features/dimensions/dim-builder.d.ts +3 -2
  13. package/dist/builder/features/dimensions/dim-node-builder.d.ts +32 -1
  14. package/dist/builder/features/havingFilter/having-builder.d.ts +2 -2
  15. package/dist/builder/features/havingFilter/having-node-builder.d.ts +10 -1
  16. package/dist/builder/features/measures/mea-builder.d.ts +3 -2
  17. package/dist/builder/features/measures/mea-node-builder.d.ts +33 -3
  18. package/dist/builder/features/whereFilter/where-builder.d.ts +2 -2
  19. package/dist/builder/features/whereFilter/where-node-builder.d.ts +11 -2
  20. package/dist/builder/index.d.ts +2 -1
  21. package/dist/builder/modules/build.d.ts +2 -2
  22. package/dist/builder/modules/index.d.ts +2 -5
  23. package/dist/builder/modules/is-empty.d.ts +1 -1
  24. package/dist/index.cjs +1578 -386
  25. package/dist/index.d.ts +6 -3
  26. package/dist/index.js +1567 -384
  27. package/dist/pipeline/vqueryDSL/aggregateMap.d.ts +50 -0
  28. package/dist/pipeline/vqueryDSL/buildOrderBy.d.ts +2 -0
  29. package/dist/pipeline/vqueryDSL/index.d.ts +2 -3
  30. package/dist/pipeline/vqueryDSL/resolveDatePredicate.d.ts +7 -0
  31. package/dist/pipeline/vqueryDSL/types.d.ts +6 -6
  32. package/dist/types/builder/VBIInterface.d.ts +7 -7
  33. package/dist/types/builder/adapter.d.ts +23 -0
  34. package/dist/types/builder/build-vseed.d.ts +3 -0
  35. package/dist/types/builder/context.d.ts +2 -2
  36. package/dist/types/builder/index.d.ts +4 -2
  37. package/dist/types/builder/observe.d.ts +2 -1
  38. package/dist/types/connector/query.d.ts +1 -0
  39. package/dist/types/dsl/dimensions/aggregate.d.ts +15 -0
  40. package/dist/types/dsl/dimensions/dimensions.d.ts +62 -0
  41. package/dist/types/dsl/encoding.d.ts +2 -2
  42. package/dist/types/dsl/havingFilter/having.d.ts +20 -1
  43. package/dist/types/dsl/index.d.ts +6 -4
  44. package/dist/types/dsl/measures/aggregate.d.ts +14 -2
  45. package/dist/types/dsl/measures/measures.d.ts +177 -8
  46. package/dist/types/dsl/sort.d.ts +13 -0
  47. package/dist/types/dsl/vbi/vbi.d.ts +103 -7
  48. package/dist/types/dsl/whereFilter/date.d.ts +95 -0
  49. package/dist/types/dsl/whereFilter/filters.d.ts +142 -5
  50. package/dist/utils/filter-guards.d.ts +2 -2
  51. package/dist/vbi/create-vbi.d.ts +14 -14
  52. package/dist/vbi/from/from-vbi-dsl-input.d.ts +4 -3
  53. package/dist/vbi/from/set-base-dsl-fields.d.ts +2 -2
  54. package/dist/vbi/generate-empty-dsl.d.ts +2 -2
  55. package/dist/vbi/normalize/types.d.ts +3 -3
  56. package/dist/vbi.d.ts +1 -14
  57. package/package.json +5 -5
  58. package/dist/builder/modules/build-vquery.d.ts +0 -4
  59. package/dist/builder/modules/build-vseed.d.ts +0 -8
  60. package/dist/builder/modules/create-builder-features.d.ts +0 -14
@@ -1,30 +1,126 @@
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
- func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
69
+ func: z.ZodEnum<{
70
+ count: "count";
71
+ countDistinct: "countDistinct";
72
+ sum: "sum";
73
+ avg: "avg";
74
+ min: "min";
75
+ max: "max";
76
+ variance: "variance";
77
+ variancePop: "variancePop";
78
+ stddev: "stddev";
79
+ median: "median";
80
+ }>;
24
81
  }, z.core.$strip>, z.ZodObject<{
25
82
  func: z.ZodLiteral<"quantile">;
26
- quantile: z.ZodNumber;
83
+ quantile: z.ZodOptional<z.ZodNumber>;
27
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>>;
28
124
  }, z.core.$strip>, z.ZodType<import("..").VBIMeasureGroup, unknown, z.core.$ZodTypeInternals<import("..").VBIMeasureGroup, unknown>>]>>;
29
125
  havingFilter: z.ZodDefault<z.ZodOptional<z.ZodType<{
30
126
  id: string;
@@ -67,5 +163,5 @@ export declare const zVBIDSL: z.ZodObject<{
67
163
  limit: z.ZodOptional<z.ZodNumber>;
68
164
  version: z.ZodNumber;
69
165
  }, z.core.$strip>;
70
- export type VBIDSLInput = z.input<typeof zVBIDSL>;
71
- export type VBIDSL = z.output<typeof zVBIDSL>;
166
+ export type VBIChartDSLInput = z.input<typeof zVBIChartDSL>;
167
+ export type VBIChartDSL = z.output<typeof zVBIChartDSL>;
@@ -0,0 +1,95 @@
1
+ import { z } from 'zod';
2
+ export type VBIWhereDateInput = string | Date;
3
+ export type VBIWhereDateUnit = 'year' | 'quarter' | 'month' | 'week' | 'day';
4
+ export type VBIWhereDateBounds = '[)' | '[]';
5
+ export type VBIWhereDatePeriod = {
6
+ unit: 'year';
7
+ year: number;
8
+ } | {
9
+ unit: 'quarter';
10
+ year: number;
11
+ quarter: 1 | 2 | 3 | 4;
12
+ } | {
13
+ unit: 'month';
14
+ year: number;
15
+ month: number;
16
+ } | {
17
+ unit: 'week';
18
+ year: number;
19
+ week: number;
20
+ } | {
21
+ unit: 'day';
22
+ date: VBIWhereDateInput;
23
+ };
24
+ export type VBIWhereDatePredicate = {
25
+ type: 'range';
26
+ start: VBIWhereDateInput;
27
+ end: VBIWhereDateInput;
28
+ bounds?: VBIWhereDateBounds;
29
+ } | {
30
+ type: 'relative';
31
+ mode: 'last' | 'next';
32
+ amount: number;
33
+ unit: VBIWhereDateUnit;
34
+ complete?: boolean;
35
+ } | {
36
+ type: 'current';
37
+ unit: VBIWhereDateUnit;
38
+ offset?: number;
39
+ } | ({
40
+ type: 'period';
41
+ } & VBIWhereDatePeriod);
42
+ export declare const zVBIWhereDatePredicate: z.ZodUnion<readonly [z.ZodObject<{
43
+ type: z.ZodLiteral<"range">;
44
+ start: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
45
+ end: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
46
+ bounds: z.ZodOptional<z.ZodEnum<{
47
+ "[)": "[)";
48
+ "[]": "[]";
49
+ }>>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ type: z.ZodLiteral<"relative">;
52
+ mode: z.ZodEnum<{
53
+ last: "last";
54
+ next: "next";
55
+ }>;
56
+ amount: z.ZodNumber;
57
+ unit: z.ZodEnum<{
58
+ year: "year";
59
+ quarter: "quarter";
60
+ month: "month";
61
+ week: "week";
62
+ day: "day";
63
+ }>;
64
+ complete: z.ZodOptional<z.ZodBoolean>;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ type: z.ZodLiteral<"current">;
67
+ unit: z.ZodEnum<{
68
+ year: "year";
69
+ quarter: "quarter";
70
+ month: "month";
71
+ week: "week";
72
+ day: "day";
73
+ }>;
74
+ offset: z.ZodOptional<z.ZodNumber>;
75
+ }, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
76
+ type: z.ZodLiteral<"period">;
77
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
78
+ unit: z.ZodLiteral<"year">;
79
+ year: z.ZodNumber;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ unit: z.ZodLiteral<"quarter">;
82
+ year: z.ZodNumber;
83
+ quarter: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ unit: z.ZodLiteral<"month">;
86
+ year: z.ZodNumber;
87
+ month: z.ZodNumber;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ unit: z.ZodLiteral<"week">;
90
+ year: z.ZodNumber;
91
+ week: z.ZodNumber;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ unit: z.ZodLiteral<"day">;
94
+ date: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
95
+ }, z.core.$strip>], "unit">>]>;
@@ -1,22 +1,159 @@
1
1
  import { z } from 'zod';
2
+ import type { VBIWhereDatePredicate } from './date';
3
+ export type { VBIWhereDateInput, VBIWhereDateUnit, VBIWhereDateBounds, VBIWhereDatePeriod, VBIWhereDatePredicate, } from './date';
4
+ export { zVBIWhereDatePredicate } from './date';
2
5
  declare const zWhereLogicalOperator: z.ZodEnum<{
3
6
  and: "and";
4
7
  or: "or";
5
8
  }>;
6
- export declare const zVBIFilter: z.ZodObject<{
9
+ export type VBIWhereScalarFilter = {
10
+ id: string;
11
+ field: string;
12
+ op: string;
13
+ value?: unknown;
14
+ };
15
+ export type VBIWhereDateFilter = {
16
+ id: string;
17
+ field: string;
18
+ op: 'date';
19
+ value: VBIWhereDatePredicate;
20
+ };
21
+ export type VBIWhereFilter = VBIWhereScalarFilter | VBIWhereDateFilter;
22
+ export declare const zVBIWhereDateFilter: z.ZodObject<{
23
+ id: z.ZodString;
24
+ field: z.ZodString;
25
+ op: z.ZodLiteral<"date">;
26
+ value: z.ZodUnion<readonly [z.ZodObject<{
27
+ type: z.ZodLiteral<"range">;
28
+ start: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
29
+ end: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
30
+ bounds: z.ZodOptional<z.ZodEnum<{
31
+ "[)": "[)";
32
+ "[]": "[]";
33
+ }>>;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ type: z.ZodLiteral<"relative">;
36
+ mode: z.ZodEnum<{
37
+ last: "last";
38
+ next: "next";
39
+ }>;
40
+ amount: z.ZodNumber;
41
+ unit: z.ZodEnum<{
42
+ year: "year";
43
+ quarter: "quarter";
44
+ month: "month";
45
+ week: "week";
46
+ day: "day";
47
+ }>;
48
+ complete: z.ZodOptional<z.ZodBoolean>;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ type: z.ZodLiteral<"current">;
51
+ unit: z.ZodEnum<{
52
+ year: "year";
53
+ quarter: "quarter";
54
+ month: "month";
55
+ week: "week";
56
+ day: "day";
57
+ }>;
58
+ offset: z.ZodOptional<z.ZodNumber>;
59
+ }, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
60
+ type: z.ZodLiteral<"period">;
61
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
62
+ unit: z.ZodLiteral<"year">;
63
+ year: z.ZodNumber;
64
+ }, z.core.$strip>, z.ZodObject<{
65
+ unit: z.ZodLiteral<"quarter">;
66
+ year: z.ZodNumber;
67
+ quarter: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ unit: z.ZodLiteral<"month">;
70
+ year: z.ZodNumber;
71
+ month: z.ZodNumber;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ unit: z.ZodLiteral<"week">;
74
+ year: z.ZodNumber;
75
+ week: z.ZodNumber;
76
+ }, z.core.$strip>, z.ZodObject<{
77
+ unit: z.ZodLiteral<"day">;
78
+ date: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
79
+ }, z.core.$strip>], "unit">>]>;
80
+ }, z.core.$strip>;
81
+ export declare const zVBIWhereScalarFilter: z.ZodObject<{
7
82
  id: z.ZodString;
8
83
  field: z.ZodString;
9
- op: z.ZodOptional<z.ZodString>;
84
+ op: z.ZodString;
10
85
  value: z.ZodOptional<z.ZodAny>;
11
86
  }, z.core.$strip>;
12
- export type VBIFilter = z.infer<typeof zVBIFilter>;
87
+ export declare const zVBIWhereFilter: z.ZodUnion<readonly [z.ZodObject<{
88
+ id: z.ZodString;
89
+ field: z.ZodString;
90
+ op: z.ZodLiteral<"date">;
91
+ value: z.ZodUnion<readonly [z.ZodObject<{
92
+ type: z.ZodLiteral<"range">;
93
+ start: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
94
+ end: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
95
+ bounds: z.ZodOptional<z.ZodEnum<{
96
+ "[)": "[)";
97
+ "[]": "[]";
98
+ }>>;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ type: z.ZodLiteral<"relative">;
101
+ mode: z.ZodEnum<{
102
+ last: "last";
103
+ next: "next";
104
+ }>;
105
+ amount: z.ZodNumber;
106
+ unit: z.ZodEnum<{
107
+ year: "year";
108
+ quarter: "quarter";
109
+ month: "month";
110
+ week: "week";
111
+ day: "day";
112
+ }>;
113
+ complete: z.ZodOptional<z.ZodBoolean>;
114
+ }, z.core.$strip>, z.ZodObject<{
115
+ type: z.ZodLiteral<"current">;
116
+ unit: z.ZodEnum<{
117
+ year: "year";
118
+ quarter: "quarter";
119
+ month: "month";
120
+ week: "week";
121
+ day: "day";
122
+ }>;
123
+ offset: z.ZodOptional<z.ZodNumber>;
124
+ }, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
125
+ type: z.ZodLiteral<"period">;
126
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
127
+ unit: z.ZodLiteral<"year">;
128
+ year: z.ZodNumber;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ unit: z.ZodLiteral<"quarter">;
131
+ year: z.ZodNumber;
132
+ quarter: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ unit: z.ZodLiteral<"month">;
135
+ year: z.ZodNumber;
136
+ month: z.ZodNumber;
137
+ }, z.core.$strip>, z.ZodObject<{
138
+ unit: z.ZodLiteral<"week">;
139
+ year: z.ZodNumber;
140
+ week: z.ZodNumber;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ unit: z.ZodLiteral<"day">;
143
+ date: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
144
+ }, z.core.$strip>], "unit">>]>;
145
+ }, z.core.$strip>, z.ZodObject<{
146
+ id: z.ZodString;
147
+ field: z.ZodString;
148
+ op: z.ZodString;
149
+ value: z.ZodOptional<z.ZodAny>;
150
+ }, z.core.$strip>]>;
13
151
  type VBIWhereBranch = {
14
152
  id: string;
15
153
  op: z.infer<typeof zWhereLogicalOperator>;
16
154
  conditions: VBIWhereClause[];
17
155
  };
18
156
  export type VBIWhereGroup = VBIWhereBranch;
19
- export type VBIWhereClause = VBIFilter | VBIWhereGroup;
157
+ export type VBIWhereClause = VBIWhereFilter | VBIWhereGroup;
20
158
  export declare const zVBIWhereGroup: z.ZodType<VBIWhereGroup>;
21
159
  export declare const zVBIWhereClause: z.ZodType<VBIWhereClause>;
22
- export {};
@@ -1,5 +1,5 @@
1
- import type { VBIFilter, VBIWhereClause, VBIWhereGroup, VBIHavingClause, VBIHavingFilter, VBIHavingGroup } from '../types/dsl';
2
- export declare function isVBIFilter(clause: VBIWhereClause): clause is VBIFilter;
1
+ import type { VBIWhereFilter, VBIWhereClause, VBIWhereGroup, VBIHavingClause, VBIHavingFilter, VBIHavingGroup } from '../types/dsl';
2
+ export declare function isVBIFilter(clause: VBIWhereClause): clause is VBIWhereFilter;
3
3
  export declare function isVBIWhereGroup(clause: VBIWhereClause): clause is VBIWhereGroup;
4
4
  export declare function isVBIHavingFilter(clause: VBIHavingClause): clause is VBIHavingFilter;
5
5
  export declare function isVBIHavingGroup(clause: VBIHavingClause): clause is VBIHavingGroup;
@@ -1,14 +1,14 @@
1
- export declare const createVBI: () => {
2
- connectorMap: Map<string, {
3
- discoverSchema: () => Promise<import("..").VBISchema>;
4
- query: (queryProps: import("..").VBIQueryProps) => Promise<import("..").VBIQueryResult>;
5
- } | (() => Promise<import("..").VBIConnector>)>;
6
- registerConnector: (id: import("../types/connector/connector").VBIConnectorId, connector: import("..").VBIConnector | (() => Promise<import("..").VBIConnector>)) => void;
7
- getConnector: (id: import("../types/connector/connector").VBIConnectorId) => Promise<{
8
- discoverSchema: () => Promise<import("..").VBISchema>;
9
- query: (queryProps: import("..").VBIQueryProps) => Promise<import("..").VBIQueryResult>;
10
- }>;
11
- generateEmptyDSL: (connectorId: import("../types/connector/connector").VBIConnectorId) => import("..").VBIDSL;
12
- from: (vbi: import("..").VBIDSLInput) => import("..").VBIBuilder;
13
- create: (vbi: import("..").VBIDSLInput) => import("..").VBIBuilder;
14
- };
1
+ import type { DefaultVBIQueryDSL, DefaultVBISeedDSL } from '../builder/adapters/vquery-vseed/types';
2
+ import { connectorMap, getConnector, registerConnector } from '../builder/connector';
3
+ import type { VBIChartBuilder } from '../builder/builder';
4
+ import type { VBIChartDSLInput, VBIChartBuilderOptions } from '../types';
5
+ import { generateEmptyChartDSL } from './generate-empty-dsl';
6
+ export interface VBIInstance<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
7
+ connectorMap: typeof connectorMap;
8
+ registerConnector: typeof registerConnector;
9
+ getConnector: typeof getConnector;
10
+ generateEmptyChartDSL: typeof generateEmptyChartDSL;
11
+ createChart: (vbi: VBIChartDSLInput, builderOptions?: VBIChartBuilderOptions<TQueryDSL, TSeedDSL>) => VBIChartBuilder<TQueryDSL, TSeedDSL>;
12
+ }
13
+ export declare function createVBI(): VBIInstance<DefaultVBIQueryDSL, DefaultVBISeedDSL>;
14
+ export declare function createVBI<TQueryDSL, TSeedDSL>(defaultBuilderOptions: VBIChartBuilderOptions<TQueryDSL, TSeedDSL>): VBIInstance<TQueryDSL, TSeedDSL>;
@@ -1,3 +1,4 @@
1
- import type { VBIDSLInput } from '../../types';
2
- import { VBIBuilder } from '../../builder';
3
- export declare const fromVBIDSLInput: (vbi: VBIDSLInput) => VBIBuilder;
1
+ import type { DefaultVBIQueryDSL, DefaultVBISeedDSL } from '../../builder/adapters/vquery-vseed/types';
2
+ import type { VBIChartDSLInput, VBIChartBuilderOptions } from '../../types';
3
+ import { VBIChartBuilder } from '../../builder/builder';
4
+ export declare const createChartBuilderFromVBIChartDSLInput: <TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL>(vbi: VBIChartDSLInput, options?: VBIChartBuilderOptions<TQueryDSL, TSeedDSL>) => VBIChartBuilder<TQueryDSL, TSeedDSL>;
@@ -1,3 +1,3 @@
1
1
  import * as Y from 'yjs';
2
- import type { VBIDSLInput } from '../../types';
3
- export declare const setBaseDSLFields: (dsl: Y.Map<any>, vbi: VBIDSLInput) => void;
2
+ import type { VBIChartDSLInput } from '../../types';
3
+ export declare const setBaseDSLFields: (dsl: Y.Map<any>, vbi: VBIChartDSLInput) => void;
@@ -1,3 +1,3 @@
1
1
  import type { VBIConnectorId } from '../types/connector/connector';
2
- import type { VBIDSL } from '../types';
3
- export declare const generateEmptyDSL: (connectorId: VBIConnectorId) => VBIDSL;
2
+ import type { VBIChartDSL } from '../types';
3
+ export declare const generateEmptyChartDSL: (connectorId: VBIConnectorId) => VBIChartDSL;
@@ -1,5 +1,5 @@
1
1
  export interface FilterGroupInput {
2
- id?: string;
3
- op?: 'and' | 'or';
4
- conditions?: any[];
2
+ id: string;
3
+ op: 'and' | 'or';
4
+ conditions: any[];
5
5
  }
package/dist/vbi.d.ts CHANGED
@@ -1,14 +1 @@
1
- export declare const VBI: {
2
- connectorMap: Map<string, {
3
- discoverSchema: () => Promise<import("./types").VBISchema>;
4
- query: (queryProps: import("./types").VBIQueryProps) => Promise<import("./types").VBIQueryResult>;
5
- } | (() => Promise<import("./types").VBIConnector>)>;
6
- registerConnector: (id: import("./types/connector/connector").VBIConnectorId, connector: import("./types").VBIConnector | (() => Promise<import("./types").VBIConnector>)) => void;
7
- getConnector: (id: import("./types/connector/connector").VBIConnectorId) => Promise<{
8
- discoverSchema: () => Promise<import("./types").VBISchema>;
9
- query: (queryProps: import("./types").VBIQueryProps) => Promise<import("./types").VBIQueryResult>;
10
- }>;
11
- generateEmptyDSL: (connectorId: import("./types/connector/connector").VBIConnectorId) => import("./types").VBIDSL;
12
- from: (vbi: import("./types").VBIDSLInput) => import("./builder").VBIBuilder;
13
- create: (vbi: import("./types").VBIDSLInput) => import("./builder").VBIBuilder;
14
- };
1
+ export declare const VBI: import(".").VBIInstance<import("./builder").DefaultVBIQueryDSL, import("@visactor/vseed").VSeed>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vbi",
3
- "version": "0.4.17",
3
+ "version": "0.4.20",
4
4
  "license": "MIT",
5
5
  "homepage": "https://visactor.github.io/VBI",
6
6
  "bugs": "https://github.com/VisActor/VBI/issues",
@@ -33,11 +33,11 @@
33
33
  "uuid": "13.0.0",
34
34
  "yjs": "13.6.28",
35
35
  "zod": "4.0.17",
36
- "@visactor/vseed": "0.4.17"
36
+ "@visactor/vseed": "0.4.20"
37
37
  },
38
38
  "optionalDependencies": {
39
- "@visactor/vquery": "0.4.17",
40
- "@visactor/vseed": "0.4.17"
39
+ "@visactor/vquery": "0.4.20",
40
+ "@visactor/vseed": "0.4.20"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@eslint/js": "9.39.0",
@@ -51,7 +51,7 @@
51
51
  "ts-morph": "26.0.0",
52
52
  "typescript": "5.9.3",
53
53
  "typescript-eslint": "8.48.0",
54
- "@visactor/vquery": "0.4.17"
54
+ "@visactor/vquery": "0.4.20"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "rslib build",
@@ -1,4 +0,0 @@
1
- import * as Y from 'yjs';
2
- import type { VQueryDSL } from '@visactor/vquery';
3
- import type { VBIBuilder } from '../vbi-builder';
4
- export declare const buildVQueryDSL: (dsl: Y.Map<any>, builder: VBIBuilder) => VQueryDSL;
@@ -1,8 +0,0 @@
1
- import type { VSeedDSL } from '@visactor/vseed';
2
- import type { VQueryDSL } from '@visactor/vquery';
3
- import type { VBIDSL } from '../../types';
4
- export interface BuildVSeedInput {
5
- vbiDSL: VBIDSL;
6
- queryDSL: VQueryDSL;
7
- }
8
- export declare const buildVSeedDSL: ({ vbiDSL, queryDSL }: BuildVSeedInput) => Promise<VSeedDSL>;
@@ -1,14 +0,0 @@
1
- import * as Y from 'yjs';
2
- import { DimensionsBuilder, MeasuresBuilder, HavingFilterBuilder, WhereFilterBuilder, ChartTypeBuilder, ThemeBuilder, LocaleBuilder, LimitBuilder, UndoManager } from '../features';
3
- export interface BuilderFeatureInstances {
4
- chartType: ChartTypeBuilder;
5
- measures: MeasuresBuilder;
6
- dimensions: DimensionsBuilder;
7
- havingFilter: HavingFilterBuilder;
8
- whereFilter: WhereFilterBuilder;
9
- theme: ThemeBuilder;
10
- locale: LocaleBuilder;
11
- limit: LimitBuilder;
12
- undoManager: UndoManager;
13
- }
14
- export declare const createBuilderFeatures: (doc: Y.Doc, dsl: Y.Map<any>) => BuilderFeatureInstances;