UNPKG

@timescaledb/schemas

Version:

This package contains Zod schemas and types for all TimescaleDB objects.

127 lines (126 loc) 4.34 kB
import { z } from 'zod'; export declare enum AggregateType { Count = "count", CountDistinct = "count_distinct", Sum = "sum", Avg = "avg", Min = "min", Max = "max", Bucket = "bucket", Candlestick = "candlestick" } export declare const AggregateTypeSchema: z.ZodNativeEnum<typeof AggregateType>; export declare const AggregateColumnOptionsSchema: z.ZodObject<{ type: z.ZodNativeEnum<typeof 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: AggregateType; price_column?: string | undefined; time_column?: string | undefined; volume_column?: string | undefined; column?: string | undefined; column_alias?: string | undefined; }, { type: AggregateType; price_column?: string | undefined; time_column?: string | undefined; volume_column?: string | undefined; column?: string | undefined; column_alias?: string | undefined; }>; export type AggregateColumnOptions = z.infer<typeof AggregateColumnOptionsSchema>; export declare const RefreshPolicySchema: 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; }>; export declare const CreateContinuousAggregateOptionsSchema: 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 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: AggregateType; price_column?: string | undefined; time_column?: string | undefined; volume_column?: string | undefined; column?: string | undefined; column_alias?: string | undefined; }, { type: 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: 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: 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; }>; export type CreateContinuousAggregateOptions = z.infer<typeof CreateContinuousAggregateOptionsSchema>;