Lint format files. Updated rng function.

This commit is contained in:
Mike Cao committed 2026-06-02 22:35:07 -07:00
1 parent 5bf1792b38
commit 306ca4a435
144 files changed
+962 -626

No files matched your search

+2 -8
View File
@@ -8,10 +8,7 @@ import { anyObjectParam, filterParams, pagingParams } from '@/lib/schema';
import { canUpdateBoard, canViewBoard } from '@/permissions';
import { createShare, getSharesByEntityId } from '@/queries/prisma';
export async function GET(
request: Request,
{ params }: { params: Promise<{ boardId: string }> },
) {
export async function GET(request: Request, { params }: { params: Promise<{ boardId: string }> }) {
const schema = z.object({
...filterParams,
...pagingParams,
@@ -39,10 +36,7 @@ export async function GET(
return json(data);
}
export async function POST(
request: Request,
{ params }: { params: Promise<{ boardId: string }> },
) {
export async function POST(request: Request, { params }: { params: Promise<{ boardId: string }> }) {
const schema = z.object({
name: z.string().max(200),
parameters: anyObjectParam.optional(),
+1 -1
View File
@@ -1,7 +1,7 @@
import { z } from 'zod';
import { parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { createBoard, getBoard, updateBoard } from '@/queries/prisma';
import { z } from 'zod';
export async function GET(request: Request) {
const { auth, error } = await parseRequest(request);
+2 -8
View File
@@ -8,10 +8,7 @@ import { anyObjectParam, filterParams, pagingParams } from '@/lib/schema';
import { canUpdateLink, canViewLink } from '@/permissions';
import { createShare, getSharesByEntityId } from '@/queries/prisma';
export async function GET(
request: Request,
{ params }: { params: Promise<{ linkId: string }> },
) {
export async function GET(request: Request, { params }: { params: Promise<{ linkId: string }> }) {
const schema = z.object({
...filterParams,
...pagingParams,
@@ -39,10 +36,7 @@ export async function GET(
return json(data);
}
export async function POST(
request: Request,
{ params }: { params: Promise<{ linkId: string }> },
) {
export async function POST(request: Request, { params }: { params: Promise<{ linkId: string }> }) {
const schema = z.object({
name: z.string().max(200),
parameters: anyObjectParam.optional(),
+2 -8
View File
@@ -8,10 +8,7 @@ import { anyObjectParam, filterParams, pagingParams } from '@/lib/schema';
import { canUpdatePixel, canViewPixel } from '@/permissions';
import { createShare, getSharesByEntityId } from '@/queries/prisma';
export async function GET(
request: Request,
{ params }: { params: Promise<{ pixelId: string }> },
) {
export async function GET(request: Request, { params }: { params: Promise<{ pixelId: string }> }) {
const schema = z.object({
...filterParams,
...pagingParams,
@@ -39,10 +36,7 @@ export async function GET(
return json(data);
}
export async function POST(
request: Request,
{ params }: { params: Promise<{ pixelId: string }> },
) {
export async function POST(request: Request, { params }: { params: Promise<{ pixelId: string }> }) {
const schema = z.object({
name: z.string().max(200),
parameters: anyObjectParam.optional(),
+1 -1
View File
@@ -3,8 +3,8 @@ import { z } from 'zod';
import { REALTIME_RANGE } from '@/lib/constants';
import { getQueryFilters, parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { canViewWebsiteSection } from '@/permissions';
import { filterParams, timezoneParam, unitParam } from '@/lib/schema';
import { canViewWebsiteSection } from '@/permissions';
import { getRealtimeData } from '@/queries/sql';
export async function GET(
+6 -6
View File
@@ -1,11 +1,11 @@
import { isbot } from 'isbot';
import { serializeError } from 'serialize-error';
import { z } from 'zod';
import { HEATMAP_EVENT_TYPE } from '@/lib/constants';
import { secret } from '@/lib/crypto';
import { getClientInfo, hasBlockedIp } from '@/lib/detect';
import { parseToken } from '@/lib/jwt';
import { fetchAccount, fetchTeam } from '@/lib/load';
import { HEATMAP_EVENT_TYPE } from '@/lib/constants';
import { getRecorderConfig } from '@/lib/recorder';
import { parseRequest } from '@/lib/request';
import { badRequest, forbidden, json, serverError } from '@/lib/response';
@@ -185,15 +185,15 @@ export async function POST(request: Request) {
visitId,
eventType: event.type === 'click' ? HEATMAP_EVENT_TYPE.click : HEATMAP_EVENT_TYPE.scroll,
nodeId: null,
x: event.type === 'click' ? event.x ?? null : null,
y: event.type === 'click' ? event.y ?? null : null,
pageX: event.type === 'click' ? event.pageX ?? null : null,
pageY: event.type === 'click' ? event.pageY ?? null : null,
x: event.type === 'click' ? (event.x ?? null) : null,
y: event.type === 'click' ? (event.y ?? null) : null,
pageX: event.type === 'click' ? (event.pageX ?? null) : null,
pageY: event.type === 'click' ? (event.pageY ?? null) : null,
pageW: event.pageW ?? null,
viewportW: event.viewportW ?? null,
viewportH: event.viewportH ?? null,
pageH: event.pageH ?? null,
scrollPct: event.type === 'scroll' ? event.scrollPct ?? null : null,
scrollPct: event.type === 'scroll' ? (event.scrollPct ?? null) : null,
urlPath: getUrlPath(event.url),
createdAt: new Date(event.timestamp ?? fallbackMs),
replayChunkIndex: null,
@@ -1,5 +1,5 @@
import { parseRequest } from '@/lib/request';
import { getRecorderConfig } from '@/lib/recorder';
import { parseRequest } from '@/lib/request';
import { getWebsite } from '@/queries/prisma';
export async function GET(