@timescaledb/schemas
Version:
This package contains Zod schemas and types for all TimescaleDB objects.
367 lines (366 loc) • 13.1 kB
TypeScript
import { z } from 'zod';
export declare enum RollupFunctionType {
Rollup = "rollup"
}
export declare const RollupFunctionTypeSchema: z.ZodNativeEnum<typeof RollupFunctionType>;
export declare const RollupRuleSchema: z.ZodObject<{
aggregateType: z.ZodOptional<z.ZodNativeEnum<typeof import("./continuous-aggregate").AggregateType>>;
rollupFn: z.ZodNativeEnum<typeof RollupFunctionType>;
sourceColumn: z.ZodString;
targetColumn: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}, {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}>;
export type RollupRule = z.infer<typeof RollupRuleSchema>;
export declare const RollupOptionsSchema: z.ZodObject<{
name: z.ZodString;
sourceView: z.ZodString;
bucketInterval: z.ZodString;
rollupRules: z.ZodArray<z.ZodObject<{
aggregateType: z.ZodOptional<z.ZodNativeEnum<typeof import("./continuous-aggregate").AggregateType>>;
rollupFn: z.ZodNativeEnum<typeof RollupFunctionType>;
sourceColumn: z.ZodString;
targetColumn: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}, {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}>, "many">;
materializedOnly: z.ZodDefault<z.ZodBoolean>;
bucketColumn: z.ZodObject<{
source: z.ZodString;
target: z.ZodString;
}, "strip", z.ZodTypeAny, {
source: string;
target: string;
}, {
source: string;
target: string;
}>;
refresh_policy: z.ZodOptional<z.ZodObject<{
start_offset: z.ZodString;
end_offset: z.ZodString;
schedule_interval: z.ZodString;
}, "strip", z.ZodTypeAny, {
schedule_interval: string;
start_offset: string;
end_offset: string;
}, {
schedule_interval: string;
start_offset: string;
end_offset: string;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
sourceView: string;
bucketInterval: string;
rollupRules: {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}[];
materializedOnly: boolean;
bucketColumn: {
source: string;
target: string;
};
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
}, {
name: string;
sourceView: string;
bucketInterval: string;
rollupRules: {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}[];
bucketColumn: {
source: string;
target: string;
};
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
materializedOnly?: boolean | undefined;
}>;
export type RollupOptions = z.infer<typeof RollupOptionsSchema>;
export declare const RollupConfigSchema: z.ZodObject<{
continuousAggregateOptions: z.ZodObject<{
name: z.ZodString;
bucket_interval: z.ZodString;
time_column: z.ZodOptional<z.ZodString>;
refresh_policy: z.ZodOptional<z.ZodObject<{
start_offset: z.ZodString;
end_offset: z.ZodString;
schedule_interval: z.ZodString;
}, "strip", z.ZodTypeAny, {
schedule_interval: string;
start_offset: string;
end_offset: string;
}, {
schedule_interval: string;
start_offset: string;
end_offset: string;
}>>;
aggregates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
type: z.ZodNativeEnum<typeof import("./continuous-aggregate").AggregateType>;
column: z.ZodOptional<z.ZodString>;
column_alias: z.ZodOptional<z.ZodString>;
time_column: z.ZodOptional<z.ZodString>;
price_column: z.ZodOptional<z.ZodString>;
volume_column: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type: import("./continuous-aggregate").AggregateType;
price_column?: string | undefined;
time_column?: string | undefined;
volume_column?: string | undefined;
column?: string | undefined;
column_alias?: string | undefined;
}, {
type: import("./continuous-aggregate").AggregateType;
price_column?: string | undefined;
time_column?: string | undefined;
volume_column?: string | undefined;
column?: string | undefined;
column_alias?: string | undefined;
}>>>;
group_columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strict", z.ZodTypeAny, {
bucket_interval: string;
name: string;
time_column?: string | undefined;
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
aggregates?: Record<string, {
type: import("./continuous-aggregate").AggregateType;
price_column?: string | undefined;
time_column?: string | undefined;
volume_column?: string | undefined;
column?: string | undefined;
column_alias?: string | undefined;
}> | undefined;
group_columns?: string[] | undefined;
}, {
bucket_interval: string;
name: string;
time_column?: string | undefined;
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
aggregates?: Record<string, {
type: import("./continuous-aggregate").AggregateType;
price_column?: string | undefined;
time_column?: string | undefined;
volume_column?: string | undefined;
column?: string | undefined;
column_alias?: string | undefined;
}> | undefined;
group_columns?: string[] | undefined;
}>;
rollupOptions: z.ZodObject<{
name: z.ZodString;
sourceView: z.ZodString;
bucketInterval: z.ZodString;
rollupRules: z.ZodArray<z.ZodObject<{
aggregateType: z.ZodOptional<z.ZodNativeEnum<typeof import("./continuous-aggregate").AggregateType>>;
rollupFn: z.ZodNativeEnum<typeof RollupFunctionType>;
sourceColumn: z.ZodString;
targetColumn: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}, {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}>, "many">;
materializedOnly: z.ZodDefault<z.ZodBoolean>;
bucketColumn: z.ZodObject<{
source: z.ZodString;
target: z.ZodString;
}, "strip", z.ZodTypeAny, {
source: string;
target: string;
}, {
source: string;
target: string;
}>;
refresh_policy: z.ZodOptional<z.ZodObject<{
start_offset: z.ZodString;
end_offset: z.ZodString;
schedule_interval: z.ZodString;
}, "strip", z.ZodTypeAny, {
schedule_interval: string;
start_offset: string;
end_offset: string;
}, {
schedule_interval: string;
start_offset: string;
end_offset: string;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
sourceView: string;
bucketInterval: string;
rollupRules: {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}[];
materializedOnly: boolean;
bucketColumn: {
source: string;
target: string;
};
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
}, {
name: string;
sourceView: string;
bucketInterval: string;
rollupRules: {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}[];
bucketColumn: {
source: string;
target: string;
};
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
materializedOnly?: boolean | undefined;
}>;
}, "strip", z.ZodTypeAny, {
continuousAggregateOptions: {
bucket_interval: string;
name: string;
time_column?: string | undefined;
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
aggregates?: Record<string, {
type: import("./continuous-aggregate").AggregateType;
price_column?: string | undefined;
time_column?: string | undefined;
volume_column?: string | undefined;
column?: string | undefined;
column_alias?: string | undefined;
}> | undefined;
group_columns?: string[] | undefined;
};
rollupOptions: {
name: string;
sourceView: string;
bucketInterval: string;
rollupRules: {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}[];
materializedOnly: boolean;
bucketColumn: {
source: string;
target: string;
};
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
};
}, {
continuousAggregateOptions: {
bucket_interval: string;
name: string;
time_column?: string | undefined;
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
aggregates?: Record<string, {
type: import("./continuous-aggregate").AggregateType;
price_column?: string | undefined;
time_column?: string | undefined;
volume_column?: string | undefined;
column?: string | undefined;
column_alias?: string | undefined;
}> | undefined;
group_columns?: string[] | undefined;
};
rollupOptions: {
name: string;
sourceView: string;
bucketInterval: string;
rollupRules: {
rollupFn: RollupFunctionType;
sourceColumn: string;
aggregateType?: import("./continuous-aggregate").AggregateType | undefined;
targetColumn?: string | undefined;
}[];
bucketColumn: {
source: string;
target: string;
};
refresh_policy?: {
schedule_interval: string;
start_offset: string;
end_offset: string;
} | undefined;
materializedOnly?: boolean | undefined;
};
}>;
export type RollupConfig = z.infer<typeof RollupConfigSchema>;
export declare const BucketIntervalSchema: z.ZodObject<{
value: z.ZodNumber;
unit: z.ZodEnum<["minute", "hour", "day", "week", "month", "year"]>;
}, "strip", z.ZodTypeAny, {
value: number;
unit: "minute" | "hour" | "day" | "week" | "month" | "year";
}, {
value: number;
unit: "minute" | "hour" | "day" | "week" | "month" | "year";
}>;
export type BucketInterval = z.infer<typeof BucketIntervalSchema>;