mirror of
https://github.com/docmost/docmost.git
synced 2026-08-30 02:25:01 +08:00
page analytics init
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
export type PageViewPayload = {
|
||||
pageId: string;
|
||||
workspaceId?: string;
|
||||
spaceId?: string;
|
||||
shareId?: string;
|
||||
userId?: string | null;
|
||||
visitorId?: string;
|
||||
};
|
||||
|
||||
export const PAGE_VIEW_SERVICE = Symbol('PAGE_VIEW_SERVICE');
|
||||
|
||||
export interface IPageViewService {
|
||||
track(payload: PageViewPayload): void | Promise<void>;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class NoopPageViewService implements IPageViewService {
|
||||
track(_payload: PageViewPayload): void {}
|
||||
}
|
||||
Reference in New Issue
Block a user