@visactor/vbi 0.4.12 → 0.4.14

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 (32) hide show
  1. package/dist/builder/index.d.ts +1 -0
  2. package/dist/builder/sub-builders/havingFilters/having-builder.d.ts +33 -20
  3. package/dist/builder/sub-builders/havingFilters/having-group-builder.d.ts +48 -0
  4. package/dist/builder/sub-builders/havingFilters/having-node-builder.d.ts +8 -0
  5. package/dist/builder/sub-builders/havingFilters/index.d.ts +1 -0
  6. package/dist/builder/sub-builders/index.d.ts +1 -1
  7. package/dist/builder/sub-builders/whereFilters/index.d.ts +1 -0
  8. package/dist/builder/sub-builders/whereFilters/where-builder.d.ts +30 -17
  9. package/dist/builder/sub-builders/whereFilters/where-group-builder.d.ts +48 -0
  10. package/dist/builder/sub-builders/whereFilters/where-node-builder.d.ts +8 -0
  11. package/dist/builder/undo-manager.d.ts +37 -0
  12. package/dist/builder/vbi-builder.d.ts +2 -1
  13. package/dist/index.cjs +446 -130
  14. package/dist/index.js +428 -121
  15. package/dist/pipeline/index.d.ts +1 -1
  16. package/dist/pipeline/vqueryDSL/buildGroupBy.d.ts +2 -0
  17. package/dist/pipeline/vqueryDSL/buildHaving.d.ts +2 -0
  18. package/dist/pipeline/vqueryDSL/buildLimit.d.ts +2 -0
  19. package/dist/pipeline/vqueryDSL/buildSelect.d.ts +2 -0
  20. package/dist/pipeline/vqueryDSL/buildWhere.d.ts +2 -0
  21. package/dist/pipeline/vqueryDSL/index.d.ts +4 -1
  22. package/dist/pipeline/vqueryDSL/types.d.ts +7 -0
  23. package/dist/types/builder/VBIInterface.d.ts +2 -1
  24. package/dist/types/dsl/havingFilters/having.d.ts +12 -7
  25. package/dist/types/dsl/index.d.ts +4 -2
  26. package/dist/types/dsl/vbi/vbi.d.ts +2 -10
  27. package/dist/types/dsl/whereFilters/filters.d.ts +12 -1
  28. package/dist/types/index.d.ts +0 -1
  29. package/dist/utils/id.d.ts +3 -0
  30. package/dist/utils/index.d.ts +1 -0
  31. package/package.json +12 -10
  32. package/dist/pipeline/vqueryDSL/buildVQuery.d.ts +0 -4
@@ -1 +1 @@
1
- export { buildVQuery } from './vqueryDSL';
1
+ export { buildVQuery } from './vqueryDSL/index';
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildGroupBy: buildPipe;
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildHaving: buildPipe;
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildLimit: buildPipe;
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildSelect: buildPipe;
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildWhere: buildPipe;
@@ -1 +1,4 @@
1
- export { buildVQuery } from './buildVQuery';
1
+ import type { VQueryDSL } from '@visactor/vquery';
2
+ import type { VBIDSL } from '../../types';
3
+ import type { VBIBuilder } from '../../builder';
4
+ export declare const buildVQuery: (vbiDSL: VBIDSL, builder: VBIBuilder) => VQueryDSL;
@@ -0,0 +1,7 @@
1
+ import type { VQueryDSL } from '@visactor/vquery';
2
+ import type { VBIDSL } from '../../types';
3
+ import type { VBIBuilder } from '../../builder';
4
+ export type buildPipe = (queryDSL: VQueryDSL, context: {
5
+ vbiDSL: VBIDSL;
6
+ builder: VBIBuilder;
7
+ }) => VQueryDSL;
@@ -2,7 +2,8 @@ import type { VQueryDSL } from '@visactor/vquery';
2
2
  import type { VBIDSL } from '../dsl';
3
3
  import type { VSeedDSL } from '@visactor/vseed';
4
4
  import type { MeasuresBuilder, DimensionsBuilder, ChartTypeBuilder, HavingFiltersBuilder, WhereFiltersBuilder } from '../../builder/sub-builders';
5
- import type { Map, Doc, UndoManager } from 'yjs';
5
+ import type { Map, Doc } from 'yjs';
6
+ import type { UndoManager } from '../../builder/undo-manager';
6
7
  export interface VBIBuilderInterface {
7
8
  doc: Doc;
8
9
  dsl: Map<any>;
@@ -1,13 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  export declare const zVBIHavingFilter: z.ZodObject<{
3
+ id: z.ZodString;
3
4
  field: z.ZodString;
4
- operator: z.ZodOptional<z.ZodString>;
5
+ op: z.ZodOptional<z.ZodString>;
5
6
  value: z.ZodOptional<z.ZodAny>;
6
7
  }, z.core.$strip>;
7
8
  export type VBIHavingFilter = z.infer<typeof zVBIHavingFilter>;
8
- export declare const zVBIHavingArray: z.ZodArray<z.ZodObject<{
9
- field: z.ZodString;
10
- operator: z.ZodOptional<z.ZodString>;
11
- value: z.ZodOptional<z.ZodAny>;
12
- }, z.core.$strip>>;
13
- export type VBIHavingArray = z.infer<typeof zVBIHavingArray>;
9
+ export declare const zVBIHavingGroup: z.ZodType<VBIHavingGroup>;
10
+ export declare const zVBIHavingClause: z.ZodType<VBIHavingClause>;
11
+ export type VBIHavingGroup = {
12
+ id: string;
13
+ op: 'and' | 'or';
14
+ conditions: VBIHavingClause[];
15
+ };
16
+ export type VBIHavingClause = VBIHavingFilter | VBIHavingGroup;
17
+ export declare function isVBIHavingFilter(clause: VBIHavingClause): clause is VBIHavingFilter;
18
+ export declare function isVBIHavingGroup(clause: VBIHavingClause): clause is VBIHavingGroup;
@@ -1,6 +1,8 @@
1
1
  export type { VBIDimensionTree, VBIDimensionGroup, VBIDimension } from './dimensions/dimensions';
2
2
  export type { VBIMeasureTree, VBIMeasureGroup, VBIMeasure } from './measures/measures';
3
- export type { VBIFilter } from './whereFilters/filters';
4
- export type { VBIHavingFilter, VBIHavingArray } from './havingFilters/having';
3
+ export type { VBIFilter, VBIWhereGroup, VBIWhereClause } from './whereFilters/filters';
4
+ export { isVBIFilter, isVBIWhereGroup } from './whereFilters/filters';
5
+ export type { VBIHavingFilter, VBIHavingGroup, VBIHavingClause } from './havingFilters/having';
6
+ export { isVBIHavingFilter, isVBIHavingGroup } from './havingFilters/having';
5
7
  export type { VBIDSLTheme } from './theme/theme';
6
8
  export type { VBIDSL } from './vbi/vbi';
@@ -17,16 +17,8 @@ export declare const zVBIDSL: z.ZodObject<{
17
17
  quantile: z.ZodNumber;
18
18
  }, z.core.$strip>], "func">;
19
19
  }, z.core.$strip>, z.ZodType<import("..").VBIMeasureGroup, unknown, z.core.$ZodTypeInternals<import("..").VBIMeasureGroup, unknown>>]>>;
20
- havingFilters: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
21
- field: z.ZodString;
22
- operator: z.ZodOptional<z.ZodString>;
23
- value: z.ZodOptional<z.ZodAny>;
24
- }, z.core.$strip>>>>;
25
- whereFilters: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
26
- field: z.ZodString;
27
- operator: z.ZodOptional<z.ZodString>;
28
- value: z.ZodOptional<z.ZodAny>;
29
- }, z.core.$strip>>>>;
20
+ havingFilters: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("..").VBIHavingClause, unknown, z.core.$ZodTypeInternals<import("..").VBIHavingClause, unknown>>>>>;
21
+ whereFilters: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<import("..").VBIWhereClause, unknown, z.core.$ZodTypeInternals<import("..").VBIWhereClause, unknown>>>>>;
30
22
  theme: z.ZodEnum<{
31
23
  light: "light";
32
24
  dark: "dark";
@@ -1,7 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  export declare const zVBIFilter: z.ZodObject<{
3
+ id: z.ZodString;
3
4
  field: z.ZodString;
4
- operator: z.ZodOptional<z.ZodString>;
5
+ op: z.ZodOptional<z.ZodString>;
5
6
  value: z.ZodOptional<z.ZodAny>;
6
7
  }, z.core.$strip>;
7
8
  export type VBIFilter = z.infer<typeof zVBIFilter>;
9
+ export declare const zVBIWhereGroup: z.ZodType<VBIWhereGroup>;
10
+ export declare const zVBIWhereClause: z.ZodType<VBIWhereClause>;
11
+ export type VBIWhereGroup = {
12
+ id: string;
13
+ op: 'and' | 'or';
14
+ conditions: VBIWhereClause[];
15
+ };
16
+ export type VBIWhereClause = VBIFilter | VBIWhereGroup;
17
+ export declare function isVBIFilter(clause: VBIWhereClause): clause is VBIFilter;
18
+ export declare function isVBIWhereGroup(clause: VBIWhereClause): clause is VBIWhereGroup;
@@ -1,4 +1,3 @@
1
1
  export * from './dsl';
2
2
  export * from './builder';
3
3
  export * from './connector';
4
- export * from './dsl/havingFilters/having';
@@ -0,0 +1,3 @@
1
+ export declare const id: {
2
+ uuid: () => string;
3
+ };
@@ -1 +1,2 @@
1
1
  export * from './tree';
2
+ export { id } from './id';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vbi",
3
- "version": "0.4.12",
3
+ "version": "0.4.14",
4
4
  "license": "MIT",
5
5
  "homepage": "https://visactor.github.io/VBI",
6
6
  "bugs": "https://github.com/VisActor/VBI/issues",
@@ -28,28 +28,30 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "zod": "4.0.17",
32
31
  "remeda": "2.28.0",
33
- "yjs": "13.6.28",
34
32
  "simple-statistics": "7.8.8",
35
- "@visactor/vseed": "0.4.12"
33
+ "uuid": "13.0.0",
34
+ "yjs": "13.6.28",
35
+ "zod": "4.0.17",
36
+ "@visactor/vseed": "0.4.14"
36
37
  },
37
38
  "optionalDependencies": {
38
- "@visactor/vseed": "0.4.12",
39
- "@visactor/vquery": "0.4.12"
39
+ "@visactor/vquery": "0.4.14",
40
+ "@visactor/vseed": "0.4.14"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@eslint/js": "9.39.0",
43
44
  "@rslib/core": "0.16.1",
44
45
  "@rstest/core": "0.8.3",
45
46
  "@types/node": "24.10.1",
47
+ "@types/uuid": "11.0.0",
46
48
  "eslint": "9.39.0",
47
49
  "globals": "16.4.0",
48
50
  "prettier": "3.6.2",
51
+ "ts-morph": "26.0.0",
49
52
  "typescript": "5.9.3",
50
53
  "typescript-eslint": "8.48.0",
51
- "ts-morph": "26.0.0",
52
- "@visactor/vquery": "0.4.12"
54
+ "@visactor/vquery": "0.4.14"
53
55
  },
54
56
  "scripts": {
55
57
  "build": "rslib build",
@@ -59,10 +61,10 @@
59
61
  "test": "rstest",
60
62
  "test:update": "rstest --update",
61
63
  "test:coverage": "rstest --coverage && node scripts/build-coverage-badge.mjs && open coverage/index.html",
62
- "typecheck": "tsc --noEmit",
64
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
63
65
  "build:test": "node scripts/build-tests.mjs",
64
66
  "build:examples": "node scripts/build-examples.mjs",
65
67
  "build:api": "node scripts/build-api.mjs",
66
- "g": "pnpm run build:test && pnpm run build:examples && pnpm run build:api && pnpm run format"
68
+ "g": "pnpm build:test && pnpm build:examples && pnpm build:api && pnpm test:update && pnpm format"
67
69
  }
68
70
  }
@@ -1,4 +0,0 @@
1
- import type { VQueryDSL } from '@visactor/vquery';
2
- import { VBIDSL } from '../../types';
3
- import { VBIBuilder } from '../..';
4
- export declare const buildVQuery: (vbiDSL: VBIDSL, builder: VBIBuilder) => VQueryDSL;