chore: clean up types

This commit is contained in:
Henry
2026-04-20 21:54:23 +01:00
parent b4b07f3120
commit 39bca3b39f
16 changed files with 84 additions and 39 deletions

View File

@@ -36,6 +36,7 @@ const cardMemberSchema = z.object({
email: z.string(),
user: z
.object({
id: z.string().nullable(),
name: z.string().nullable(),
})
.nullable(),
@@ -180,6 +181,7 @@ export const activityItemSchema = z.object({
publicId: z.string(),
user: z
.object({
id: z.string().nullable(),
name: z.string().nullable(),
email: z.string(),
image: z.string().nullable(),
@@ -189,6 +191,7 @@ export const activityItemSchema = z.object({
.nullable(),
user: z
.object({
id: z.string().nullable(),
name: z.string().nullable(),
email: z.string(),
image: z.string().nullable(),

View File

@@ -25,6 +25,7 @@ export const checklistResponseSchema = z.object({
// Shared user sub-object (used inside member/workspace responses)
export const userSchema = z.object({
id: z.string().nullable(),
name: z.string().nullable(),
email: z.string(),
image: z.string().nullable(),

View File

@@ -10,7 +10,7 @@ export const workspaceListItemSchema = z.object({
name: z.string(),
description: z.string().nullable(),
slug: z.string(),
plan: z.enum(["free", "pro", "enterprise"]),
plan: z.enum(["free", "team", "pro", "enterprise"]),
weekStartDay: z.number().nullable(),
deletedAt: z.date().nullable(),
}),
@@ -25,6 +25,7 @@ const workspaceMemberDetailSchema = z.object({
createdAt: z.date(),
user: z
.object({
id: z.string().nullable(),
name: z.string().nullable(),
email: z.string().optional(),
image: z.string().nullable(),
@@ -72,7 +73,7 @@ export const workspaceCreateResponseSchema = z.object({
name: z.string(),
slug: z.string(),
description: z.string().nullable(),
plan: z.enum(["free", "pro", "enterprise"]),
plan: z.enum(["free", "team", "pro", "enterprise"]),
});
// ─── workspace.update ────────────────────────────────────────
@@ -81,7 +82,7 @@ export const workspaceUpdateResponseSchema = z.object({
name: z.string(),
slug: z.string(),
description: z.string().nullable(),
plan: z.enum(["free", "pro", "enterprise"]),
plan: z.enum(["free", "team", "pro", "enterprise"]),
showEmailsToMembers: z.boolean().nullable(),
weekStartDay: z.number().nullable(),
});

View File

@@ -170,7 +170,7 @@ export function createPlugins(db: dbClient) {
if (authorization?.startsWith("Bearer ")) {
return authorization.slice(7);
}
return ctx.headers?.get("x-api-key") ?? undefined;
return ctx.headers?.get("x-api-key") ?? null;
},
rateLimit: {
enabled: true,

View File

@@ -220,6 +220,7 @@ export const getByPublicId = async (
with: {
user: {
columns: {
id: true,
name: true,
email: true,
image: true,
@@ -278,6 +279,7 @@ export const getByPublicId = async (
with: {
user: {
columns: {
id: true,
name: true,
email: true,
image: true,