Rename session recording to session replay across the codebase.
Renames all files, components, database schema, API routes, hooks, messages, and build config from "recording" to "replay" terminology. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
72b5c658e2
commit
0a3cf7a9ff
@@ -22,10 +22,10 @@ export * from './getWeeklyTraffic';
|
||||
export * from './pageviews/getPageviewExpandedMetrics';
|
||||
export * from './pageviews/getPageviewMetrics';
|
||||
export * from './pageviews/getPageviewStats';
|
||||
export * from './recordings/deleteRecordingsByWebsite';
|
||||
export * from './recordings/getRecordingChunks';
|
||||
export * from './recordings/getSessionRecordings';
|
||||
export * from './recordings/saveRecordingChunk';
|
||||
export * from './replays/deleteReplaysByWebsite';
|
||||
export * from './replays/getReplayChunks';
|
||||
export * from './replays/getSessionReplays';
|
||||
export * from './replays/saveReplayChunk';
|
||||
export * from './reports/getBreakdown';
|
||||
export * from './reports/getFunnel';
|
||||
export * from './reports/getJourney';
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export * from './deleteRecordingsByWebsite';
|
||||
export * from './getRecordingChunks';
|
||||
export * from './getSessionRecordings';
|
||||
export * from './saveRecordingChunk';
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import prisma from '@/lib/prisma';
|
||||
|
||||
export async function deleteRecordingsByWebsite(websiteId: string) {
|
||||
export async function deleteReplaysByWebsite(websiteId: string) {
|
||||
return relationalQuery(websiteId);
|
||||
}
|
||||
|
||||
async function relationalQuery(websiteId: string) {
|
||||
return prisma.client.sessionRecording.deleteMany({
|
||||
return prisma.client.sessionReplay.deleteMany({
|
||||
where: { websiteId },
|
||||
});
|
||||
}
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import prisma from '@/lib/prisma';
|
||||
|
||||
export async function getRecordingChunks(websiteId: string, sessionId: string) {
|
||||
export async function getReplayChunks(websiteId: string, sessionId: string) {
|
||||
return relationalQuery(websiteId, sessionId);
|
||||
}
|
||||
|
||||
async function relationalQuery(websiteId: string, sessionId: string) {
|
||||
return prisma.client.sessionRecording.findMany({
|
||||
return prisma.client.sessionReplay.findMany({
|
||||
where: {
|
||||
websiteId,
|
||||
sessionId,
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
import prisma from '@/lib/prisma';
|
||||
import type { QueryFilters } from '@/lib/types';
|
||||
|
||||
const FUNCTION_NAME = 'getSessionRecordings';
|
||||
const FUNCTION_NAME = 'getSessionReplays';
|
||||
|
||||
export async function getSessionRecordings(...args: [websiteId: string, filters: QueryFilters]) {
|
||||
export async function getSessionReplays(...args: [websiteId: string, filters: QueryFilters]) {
|
||||
return relationalQuery(...args);
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
|
||||
session.country,
|
||||
session.city,
|
||||
sum(sr.event_count) as "eventCount",
|
||||
count(sr.recording_id) as "chunkCount",
|
||||
count(sr.replay_id) as "chunkCount",
|
||||
min(sr.started_at) as "startedAt",
|
||||
max(sr.ended_at) as "endedAt",
|
||||
(extract(epoch from max(sr.ended_at) - min(sr.started_at)) * 1000)::bigint as "duration",
|
||||
max(sr.created_at) as "createdAt"
|
||||
from session_recording sr
|
||||
from session_replay sr
|
||||
left join session on session.session_id = sr.session_id
|
||||
and session.website_id = sr.website_id
|
||||
where sr.website_id = {{websiteId::uuid}}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './deleteReplaysByWebsite';
|
||||
export * from './getReplayChunks';
|
||||
export * from './getSessionReplays';
|
||||
export * from './saveReplayChunk';
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
import { uuid } from '@/lib/crypto';
|
||||
import prisma from '@/lib/prisma';
|
||||
|
||||
export interface SaveRecordingChunkArgs {
|
||||
export interface SaveReplayChunkArgs {
|
||||
websiteId: string;
|
||||
sessionId: string;
|
||||
chunkIndex: number;
|
||||
@@ -11,7 +11,7 @@ export interface SaveRecordingChunkArgs {
|
||||
endedAt: Date;
|
||||
}
|
||||
|
||||
export async function saveRecordingChunk(args: SaveRecordingChunkArgs) {
|
||||
export async function saveReplayChunk(args: SaveReplayChunkArgs) {
|
||||
return relationalQuery(args);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ async function relationalQuery({
|
||||
eventCount,
|
||||
startedAt,
|
||||
endedAt,
|
||||
}: SaveRecordingChunkArgs) {
|
||||
return prisma.client.sessionRecording.create({
|
||||
}: SaveReplayChunkArgs) {
|
||||
return prisma.client.sessionReplay.create({
|
||||
data: {
|
||||
id: uuid(),
|
||||
websiteId,
|
||||
Reference in New Issue
Block a user