autumn-js
Version:
Autumn JS Library
79 lines (76 loc) • 2.9 kB
text/typescript
import { z } from 'zod/v4';
declare const PagePaginationDefaults: {
Limit: number;
MaxLimit: number;
};
declare const PagePaginationQuerySchema: z.ZodObject<{
offset: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
}, z.core.$strip>;
declare const EventsListParamsSchema: z.ZodObject<{
offset: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
featureId: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>;
customRange: z.ZodOptional<z.ZodObject<{
start: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
end: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
type EventsListParams = z.infer<typeof EventsListParamsSchema>;
declare const RangeEnumSchema: z.ZodEnum<{
"24h": "24h";
"7d": "7d";
"30d": "30d";
"90d": "90d";
last_cycle: "last_cycle";
"1bc": "1bc";
"3bc": "3bc";
}>;
type RangeEnum = z.infer<typeof RangeEnumSchema>;
declare const BinSizeEnumSchema: z.ZodDefault<z.ZodEnum<{
day: "day";
hour: "hour";
}>>;
type BinSizeEnum = z.infer<typeof BinSizeEnumSchema>;
declare const EventAggregationParamsSchema: z.ZodObject<{
featureId: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>;
groupBy: z.ZodOptional<z.ZodString>;
range: z.ZodOptional<z.ZodEnum<{
"24h": "24h";
"7d": "7d";
"30d": "30d";
"90d": "90d";
last_cycle: "last_cycle";
"1bc": "1bc";
"3bc": "3bc";
}>>;
binSize: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
day: "day";
hour: "hour";
}>>>;
customRange: z.ZodOptional<z.ZodObject<{
start: z.ZodNumber;
end: z.ZodNumber;
}, z.core.$strip>>;
}, z.core.$strip>;
type EventAggregationParams = z.infer<typeof EventAggregationParamsSchema>;
type FlatAggregatedRow = {
period: number;
[featureName: string]: number;
};
type GroupedAggregatedRow = {
period: number;
} & {
[featureName: string]: Record<string, number>;
};
type AggregatedEventRow = FlatAggregatedRow | GroupedAggregatedRow;
declare const EventAggregationTotalSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
count: z.ZodNumber;
sum: z.ZodNumber;
}, z.core.$strip>>;
type EventAggregationTotal = z.infer<typeof EventAggregationTotalSchema>;
type EventAggregationResponse = {
list: AggregatedEventRow[];
total: EventAggregationTotal;
};
export { type AggregatedEventRow, type BinSizeEnum, BinSizeEnumSchema, type EventAggregationParams, EventAggregationParamsSchema, type EventAggregationResponse, type EventAggregationTotal, EventAggregationTotalSchema, type EventsListParams, EventsListParamsSchema, type FlatAggregatedRow, type GroupedAggregatedRow, PagePaginationDefaults, PagePaginationQuerySchema, type RangeEnum, RangeEnumSchema };