format:fix

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-13 08:55:24 +01:00
parent 558318c312
commit 48aecc4b37
117 changed files with 4455 additions and 667 deletions

View File

@@ -1,5 +1,8 @@
import { getDaysOldDate } from '@/utils/date';
import { round } from '@/utils/math';
import * as mathjs from 'mathjs';
import { sort } from 'ramda';
import { alphabetIds, NOT_SET_VALUE } from '@openpanel/constants';
import { chQuery, convertClickhouseDateToJs, getChartSql } from '@openpanel/db';
import type {
@@ -9,8 +12,6 @@ import type {
IGetChartDataInput,
IInterval,
} from '@openpanel/validation';
import * as mathjs from 'mathjs';
import { sort } from 'ramda';
export type GetChartDataResult = Awaited<ReturnType<typeof getChartData>>;
export interface ResultItem {

View File

@@ -4,6 +4,9 @@ import {
publicProcedure,
} from '@/server/api/trpc';
import { average, max, min, round, sum } from '@/utils/math';
import { flatten, map, pipe, prop, repeat, reverse, sort, uniq } from 'ramda';
import { z } from 'zod';
import {
chQuery,
createSqlBuilder,
@@ -12,8 +15,6 @@ import {
} from '@openpanel/db';
import { zChartInput } from '@openpanel/validation';
import type { IChartEvent, IChartInput } from '@openpanel/validation';
import { flatten, map, pipe, prop, repeat, reverse, sort, uniq } from 'ramda';
import { z } from 'zod';
import {
getChartData,

View File

@@ -1,9 +1,10 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { db, getId } from '@/server/db';
import type { Prisma } from '@openpanel/db';
import { PrismaError } from 'prisma-error-enum';
import { z } from 'zod';
import type { Prisma } from '@openpanel/db';
export const dashboardRouter = createTRPCRouter({
get: protectedProcedure
.input(z.object({ id: z.string() }))

View File

@@ -1,7 +1,8 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { db } from '@openpanel/db';
import { z } from 'zod';
import { db } from '@openpanel/db';
export const eventRouter = createTRPCRouter({
updateEventMeta: protectedProcedure
.input(

View File

@@ -1,8 +1,9 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { clerkClient } from '@clerk/nextjs';
import { z } from 'zod';
import { getOrganizationBySlug } from '@openpanel/db';
import { zInviteUser } from '@openpanel/validation';
import { z } from 'zod';
export const organizationRouter = createTRPCRouter({
list: protectedProcedure.query(() => {

View File

@@ -4,10 +4,11 @@ import {
publicProcedure,
} from '@/server/api/trpc';
import { db } from '@/server/db';
import { chQuery, createSqlBuilder } from '@openpanel/db';
import { flatten, map, pipe, prop, sort, uniq } from 'ramda';
import { z } from 'zod';
import { chQuery, createSqlBuilder } from '@openpanel/db';
export const profileRouter = createTRPCRouter({
list: protectedProcedure
.input(

View File

@@ -1,8 +1,9 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { db } from '@/server/db';
import { z } from 'zod';
import { transformReport } from '@openpanel/db';
import { zChartInput } from '@openpanel/validation';
import { z } from 'zod';
export const reportRouter = createTRPCRouter({
get: protectedProcedure

View File

@@ -1,8 +1,9 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { db } from '@/server/db';
import { zShareOverview } from '@openpanel/validation';
import ShortUniqueId from 'short-unique-id';
import { zShareOverview } from '@openpanel/validation';
const uid = new ShortUniqueId({ length: 6 });
export const shareRouter = createTRPCRouter({

View File

@@ -1,8 +1,9 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { clerkClient } from '@clerk/nextjs';
import { transformUser } from '@openpanel/db';
import { z } from 'zod';
import { transformUser } from '@openpanel/db';
export const userRouter = createTRPCRouter({
update: protectedProcedure
.input(