mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
change in progress
This commit is contained in:
16
dashboard/server/services/DataService.ts
Normal file
16
dashboard/server/services/DataService.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { VisitModel } from "@schema/metrics/VisitSchema";
|
||||
import { EventModel } from "@schema/metrics/EventSchema";
|
||||
|
||||
import type { Model } from "mongoose";
|
||||
|
||||
|
||||
export type TModelName = keyof typeof allowedModels;
|
||||
|
||||
export const allowedModels: Record<string, { model: Model<any> }> = {
|
||||
'events': {
|
||||
model: EventModel,
|
||||
},
|
||||
'visits': {
|
||||
model: VisitModel,
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import type mongoose from "mongoose";
|
||||
|
||||
|
||||
export type TimelineAggregationOptions = {
|
||||
projectId: mongoose.Schema.Types.ObjectId,
|
||||
projectId: mongoose.Schema.Types.ObjectId | mongoose.Types.ObjectId,
|
||||
model: mongoose.Model<any>,
|
||||
from: string | number,
|
||||
to: string | number,
|
||||
|
||||
Reference in New Issue
Block a user