Website views chart uses kind=all across page kinds; home hits also count static-images loads. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
497 B
TypeScript
25 lines
497 B
TypeScript
import { Type } from 'class-transformer';
|
|
import { IsIn, IsInt, IsOptional, Max, Min } from 'class-validator';
|
|
import { WEBSITE_PAGE_KINDS } from '../website-analytics.types';
|
|
|
|
const ACTIVITY_KINDS = [
|
|
...WEBSITE_PAGE_KINDS,
|
|
'all',
|
|
'website',
|
|
'product',
|
|
'portfolio',
|
|
'blog',
|
|
] as const;
|
|
|
|
export class ViewActivityQueryDto {
|
|
@IsIn([...ACTIVITY_KINDS])
|
|
kind!: (typeof ACTIVITY_KINDS)[number];
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(90)
|
|
days?: number;
|
|
}
|