@visactor/vbi 0.0.0
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/README.md +0 -0
- package/dist/builder/connector.d.ts +7 -0
- package/dist/builder/index.d.ts +3 -0
- package/dist/builder/sub-builders/chart-type/chart-type-builder.d.ts +39 -0
- package/dist/builder/sub-builders/chart-type/index.d.ts +1 -0
- package/dist/builder/sub-builders/dimensions/dim-builder.d.ts +48 -0
- package/dist/builder/sub-builders/dimensions/dim-node-builder.d.ts +22 -0
- package/dist/builder/sub-builders/dimensions/index.d.ts +2 -0
- package/dist/builder/sub-builders/havingFilters/having-builder.d.ts +55 -0
- package/dist/builder/sub-builders/havingFilters/having-node-builder.d.ts +27 -0
- package/dist/builder/sub-builders/havingFilters/index.d.ts +2 -0
- package/dist/builder/sub-builders/index.d.ts +5 -0
- package/dist/builder/sub-builders/measures/index.d.ts +2 -0
- package/dist/builder/sub-builders/measures/mea-builder.d.ts +52 -0
- package/dist/builder/sub-builders/measures/mea-node-builder.d.ts +32 -0
- package/dist/builder/sub-builders/whereFilters/index.d.ts +1 -0
- package/dist/builder/sub-builders/whereFilters/where-builder.d.ts +55 -0
- package/dist/builder/sub-builders/whereFilters/where-node-builder.d.ts +27 -0
- package/dist/builder/vbi-builder.d.ts +32 -0
- package/dist/builder/vbi.d.ts +16 -0
- package/dist/index.cjs +689 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +628 -0
- package/dist/pipeline/index.d.ts +1 -0
- package/dist/pipeline/vqueryDSL/buildVQuery.d.ts +4 -0
- package/dist/pipeline/vqueryDSL/index.d.ts +1 -0
- package/dist/types/builder/VBIInterface.d.ts +21 -0
- package/dist/types/builder/context.d.ts +4 -0
- package/dist/types/builder/index.d.ts +2 -0
- package/dist/types/builder/observe.d.ts +2 -0
- package/dist/types/connector/connector.d.ts +9 -0
- package/dist/types/connector/index.d.ts +3 -0
- package/dist/types/connector/query.d.ts +15 -0
- package/dist/types/connector/schema.d.ts +8 -0
- package/dist/types/dsl/dimensions/dimensions.d.ts +16 -0
- package/dist/types/dsl/encoding.d.ts +11 -0
- package/dist/types/dsl/havingFilters/having.d.ts +13 -0
- package/dist/types/dsl/index.d.ts +6 -0
- package/dist/types/dsl/locale/locale.d.ts +6 -0
- package/dist/types/dsl/measures/aggregate.d.ts +7 -0
- package/dist/types/dsl/measures/measures.d.ts +30 -0
- package/dist/types/dsl/theme/theme.d.ts +6 -0
- package/dist/types/dsl/vbi/vbi.d.ts +41 -0
- package/dist/types/dsl/whereFilters/filters.d.ts +7 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/tree/index.d.ts +1 -0
- package/dist/utils/tree/traverse.d.ts +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { VQueryDSL } from '@visactor/vquery';
|
|
3
|
+
export declare const zVBIQueryResult: z.ZodObject<{
|
|
4
|
+
dataset: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull, z.ZodUndefined, z.ZodBoolean]>>>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type VBIQueryResult = z.infer<typeof zVBIQueryResult>;
|
|
7
|
+
export declare const zVBIQueryProps: z.ZodObject<{
|
|
8
|
+
queryDSL: z.ZodCustom<VQueryDSL, VQueryDSL>;
|
|
9
|
+
schema: z.ZodArray<z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
type: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
connectorId: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type VBIQueryProps = z.infer<typeof zVBIQueryProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zSchema: z.ZodArray<z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
type: z.ZodString;
|
|
5
|
+
}, z.core.$strip>>;
|
|
6
|
+
export type Schema = z.infer<typeof zSchema>;
|
|
7
|
+
export declare const zDiscoverSchema: z.ZodCustom<() => Promise<Schema>, () => Promise<Schema>>;
|
|
8
|
+
export type DiscoverSchema = z.infer<typeof zDiscoverSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zVBIDimensionSchema: z.ZodObject<{
|
|
3
|
+
field: z.ZodString;
|
|
4
|
+
alias: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const zVBIDimensionGroupSchema: z.ZodType<VBIDimensionGroup>;
|
|
7
|
+
export declare const zVBIDimensionTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
8
|
+
field: z.ZodString;
|
|
9
|
+
alias: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodType<VBIDimensionGroup, unknown, z.core.$ZodTypeInternals<VBIDimensionGroup, unknown>>]>>;
|
|
11
|
+
export type VBIDimension = z.infer<typeof zVBIDimensionSchema>;
|
|
12
|
+
export type VBIDimensionGroup = {
|
|
13
|
+
alias: string;
|
|
14
|
+
children: (VBIDimension | VBIDimensionGroup)[];
|
|
15
|
+
};
|
|
16
|
+
export type VBIDimensionTree = z.infer<typeof zVBIDimensionTree>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const VBI_SUPPORTED_ENCODINGS: readonly ["yAxis", "xAxis", "color", "label", "tooltip", "size"];
|
|
3
|
+
export declare const zVBIEncoding: z.ZodEnum<{
|
|
4
|
+
yAxis: "yAxis";
|
|
5
|
+
xAxis: "xAxis";
|
|
6
|
+
color: "color";
|
|
7
|
+
label: "label";
|
|
8
|
+
tooltip: "tooltip";
|
|
9
|
+
size: "size";
|
|
10
|
+
}>;
|
|
11
|
+
export type VBIEncoding = z.infer<typeof zVBIEncoding>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zVBIHavingFilter: z.ZodObject<{
|
|
3
|
+
field: z.ZodString;
|
|
4
|
+
operator: z.ZodOptional<z.ZodString>;
|
|
5
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
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>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { VBIDimensionTree, VBIDimensionGroup, VBIDimension } from './dimensions/dimensions';
|
|
2
|
+
export type { VBIMeasureTree, VBIMeasureGroup, VBIMeasure } from './measures/measures';
|
|
3
|
+
export type { VBIFilter } from './whereFilters/filters';
|
|
4
|
+
export type { VBIHavingFilter, VBIHavingArray } from './havingFilters/having';
|
|
5
|
+
export type { VBIDSLTheme } from './theme/theme';
|
|
6
|
+
export type { VBIDSL } from './vbi/vbi';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zAggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
func: z.ZodLiteral<"quantile">;
|
|
6
|
+
quantile: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>], "func">;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zVBIMeasure: z.ZodObject<{
|
|
3
|
+
field: z.ZodString;
|
|
4
|
+
alias: z.ZodString;
|
|
5
|
+
encoding: z.ZodLiteral<"yAxis" | "xAxis" | "color" | "label" | "tooltip" | "size">;
|
|
6
|
+
aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
func: z.ZodLiteral<"quantile">;
|
|
10
|
+
quantile: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>], "func">;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const zVBIMeasureGroup: z.ZodType<VBIMeasureGroup>;
|
|
14
|
+
export declare const zVBIMeasureTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
+
field: z.ZodString;
|
|
16
|
+
alias: z.ZodString;
|
|
17
|
+
encoding: z.ZodLiteral<"yAxis" | "xAxis" | "color" | "label" | "tooltip" | "size">;
|
|
18
|
+
aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
func: z.ZodLiteral<"quantile">;
|
|
22
|
+
quantile: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>], "func">;
|
|
24
|
+
}, z.core.$strip>, z.ZodType<VBIMeasureGroup, unknown, z.core.$ZodTypeInternals<VBIMeasureGroup, unknown>>]>>;
|
|
25
|
+
export type VBIMeasure = z.infer<typeof zVBIMeasure>;
|
|
26
|
+
export type VBIMeasureGroup = {
|
|
27
|
+
alias: string;
|
|
28
|
+
children: (VBIMeasure | VBIMeasureGroup)[];
|
|
29
|
+
};
|
|
30
|
+
export type VBIMeasureTree = z.infer<typeof zVBIMeasureTree>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zVBIDSL: z.ZodObject<{
|
|
3
|
+
connectorId: z.ZodString;
|
|
4
|
+
chartType: z.ZodCustom<any, any>;
|
|
5
|
+
dimensions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
6
|
+
field: z.ZodString;
|
|
7
|
+
alias: z.ZodString;
|
|
8
|
+
}, z.core.$strip>, z.ZodType<import("..").VBIDimensionGroup, unknown, z.core.$ZodTypeInternals<import("..").VBIDimensionGroup, unknown>>]>>;
|
|
9
|
+
measures: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
10
|
+
field: z.ZodString;
|
|
11
|
+
alias: z.ZodString;
|
|
12
|
+
encoding: z.ZodLiteral<"yAxis" | "xAxis" | "color" | "label" | "tooltip" | "size">;
|
|
13
|
+
aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
func: z.ZodLiteral<"quantile">;
|
|
17
|
+
quantile: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>], "func">;
|
|
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>>>>;
|
|
30
|
+
theme: z.ZodEnum<{
|
|
31
|
+
light: "light";
|
|
32
|
+
dark: "dark";
|
|
33
|
+
}>;
|
|
34
|
+
locale: z.ZodEnum<{
|
|
35
|
+
"en-US": "en-US";
|
|
36
|
+
"zh-CN": "zh-CN";
|
|
37
|
+
}>;
|
|
38
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
version: z.ZodNumber;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export type VBIDSL = z.infer<typeof zVBIDSL>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './traverse';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { preorderTraverse, findTreeNodesBy } from '@visactor/vseed';
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visactor/vbi",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"source": "./src/index.ts",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rslib build",
|
|
20
|
+
"dev": "rslib build --watch --no-clean",
|
|
21
|
+
"format": "prettier --write .",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"test": "rstest",
|
|
24
|
+
"test:update": "rstest --update",
|
|
25
|
+
"test:coverage": "rstest --coverage && node scripts/build-coverage-badge.mjs && open coverage/index.html",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"build:test": "node scripts/build-tests.mjs",
|
|
28
|
+
"build:examples": "node scripts/build-examples.mjs",
|
|
29
|
+
"build:api": "node scripts/build-api.mjs",
|
|
30
|
+
"g": "pnpm run build:test && pnpm run build:examples && pnpm run build:api && pnpm run format"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"zod": "4.0.17",
|
|
34
|
+
"remeda": "2.28.0",
|
|
35
|
+
"yjs": "13.6.28",
|
|
36
|
+
"simple-statistics": "7.8.8",
|
|
37
|
+
"@visactor/vseed": "workspace:*"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@visactor/vseed": "workspace:*"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@visactor/vquery": "workspace:*",
|
|
44
|
+
"@eslint/js": "9.39.0",
|
|
45
|
+
"@rslib/core": "0.16.1",
|
|
46
|
+
"@rstest/core": "0.8.3",
|
|
47
|
+
"@types/node": "24.10.1",
|
|
48
|
+
"eslint": "9.39.0",
|
|
49
|
+
"globals": "16.4.0",
|
|
50
|
+
"prettier": "3.6.2",
|
|
51
|
+
"typescript": "5.9.3",
|
|
52
|
+
"typescript-eslint": "8.48.0",
|
|
53
|
+
"ts-morph": "26.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|