mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* feat: Cal.diy — community-driven MIT-licensed fork of Cal.com This squashed commit contains all Cal.diy changes applied on top of calcom/cal.com main: - Rebrand Cal.com to Cal.diy across the entire codebase - Remove Enterprise Edition (EE) features, license checks, and AGPL restrictions - Switch license from AGPL-3.0 to MIT - Remove docs/ directory (migrated to Nextra at cal.diy) - Remove dead code: org tests, EE tips, platform nav, premium username, SAML/SSO, etc. - Clean up .env.example for self-hosted Cal.diy - Update Docker image references to calcom/cal.diy - Update README, CONTRIBUTING.md, and issue templates for Cal.diy community fork - Add PR welcome bot for Cal.diy contributors - Fix API v2 breaking changes oasdiff ignore entries - Replace Blacksmith CI runners with default GitHub Actions 3893 files changed, 20789 insertions(+), 411020 deletions(-) Co-Authored-By: [email protected] <[email protected]> * refactor: remove org-specific /organizations/:orgId endpoints from API v2 atoms controllers (#1701) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: revert Cal.diy Inc to Cal.com, Inc. in license files, copyright notices, and package metadata (#1702) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * rip out org related comments in api v2 --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
129 lines
3.5 KiB
TypeScript
129 lines
3.5 KiB
TypeScript
import { FULL_NAME_LENGTH_MAX_LIMIT } from "@calcom/lib/constants";
|
|
import { timeZoneSchema } from "@calcom/lib/dayjs/timeZone.schema";
|
|
import { bookerLayouts, userMetadata } from "@calcom/prisma/zod-utils";
|
|
import { z } from "zod";
|
|
|
|
export type TUpdateUserMetadataAllowedKeys = {
|
|
sessionTimeout?: number;
|
|
defaultBookerLayouts?: z.infer<typeof bookerLayouts>;
|
|
};
|
|
|
|
export const updateUserMetadataAllowedKeys: z.ZodType<TUpdateUserMetadataAllowedKeys> = z.object({
|
|
sessionTimeout: z.number().optional(), // Minutes
|
|
defaultBookerLayouts: bookerLayouts.optional(),
|
|
});
|
|
|
|
export type TUpdateProfileInputSchemaInput = {
|
|
username?: string;
|
|
name?: string;
|
|
email?: string;
|
|
bio?: string;
|
|
avatarUrl?: string | null;
|
|
timeZone?: string;
|
|
weekStart?: string;
|
|
hideBranding?: boolean;
|
|
allowDynamicBooking?: boolean;
|
|
allowSEOIndexing?: boolean;
|
|
receiveMonthlyDigestEmail?: boolean;
|
|
requiresBookerEmailVerification?: boolean;
|
|
brandColor?: string;
|
|
darkBrandColor?: string;
|
|
theme?: string | null;
|
|
appTheme?: string | null;
|
|
completedOnboarding?: boolean;
|
|
locale?: string;
|
|
timeFormat?: number;
|
|
metadata?: z.infer<typeof userMetadata>;
|
|
travelSchedules?: {
|
|
id?: number;
|
|
timeZone: string;
|
|
endDate?: Date;
|
|
startDate: Date;
|
|
}[];
|
|
secondaryEmails?: {
|
|
id: number;
|
|
email: string;
|
|
isDeleted?: boolean;
|
|
}[];
|
|
};
|
|
|
|
export type TUpdateProfileInputSchema = {
|
|
username?: string;
|
|
name?: string;
|
|
email?: string;
|
|
bio?: string;
|
|
avatarUrl?: string | null;
|
|
timeZone?: string;
|
|
weekStart?: string;
|
|
hideBranding?: boolean;
|
|
allowDynamicBooking?: boolean;
|
|
allowSEOIndexing?: boolean;
|
|
receiveMonthlyDigestEmail?: boolean;
|
|
requiresBookerEmailVerification?: boolean;
|
|
brandColor?: string;
|
|
darkBrandColor?: string;
|
|
theme?: string | null;
|
|
appTheme?: string | null;
|
|
completedOnboarding?: boolean;
|
|
locale?: string;
|
|
timeFormat?: number;
|
|
metadata?: z.infer<typeof userMetadata>;
|
|
travelSchedules?: {
|
|
id?: number;
|
|
timeZone: string;
|
|
endDate?: Date;
|
|
startDate: Date;
|
|
}[];
|
|
secondaryEmails?: {
|
|
id: number;
|
|
email: string;
|
|
isDeleted: boolean;
|
|
}[];
|
|
};
|
|
|
|
export const ZUpdateProfileInputSchema: z.ZodType<
|
|
TUpdateProfileInputSchema,
|
|
z.ZodTypeDef,
|
|
TUpdateProfileInputSchemaInput
|
|
> = z.object({
|
|
username: z.string().optional(),
|
|
name: z.string().max(FULL_NAME_LENGTH_MAX_LIMIT).optional(),
|
|
email: z.string().optional(),
|
|
bio: z.string().optional(),
|
|
avatarUrl: z.string().nullable().optional(),
|
|
timeZone: timeZoneSchema.optional(),
|
|
weekStart: z.string().optional(),
|
|
hideBranding: z.boolean().optional(),
|
|
allowDynamicBooking: z.boolean().optional(),
|
|
allowSEOIndexing: z.boolean().optional(),
|
|
receiveMonthlyDigestEmail: z.boolean().optional(),
|
|
requiresBookerEmailVerification: z.boolean().optional(),
|
|
brandColor: z.string().optional(),
|
|
darkBrandColor: z.string().optional(),
|
|
theme: z.string().optional().nullable(),
|
|
appTheme: z.string().optional().nullable(),
|
|
completedOnboarding: z.boolean().optional(),
|
|
locale: z.string().optional(),
|
|
timeFormat: z.number().optional(),
|
|
metadata: userMetadata.optional(),
|
|
travelSchedules: z
|
|
.array(
|
|
z.object({
|
|
id: z.number().optional(),
|
|
timeZone: timeZoneSchema,
|
|
endDate: z.date().optional(),
|
|
startDate: z.date(),
|
|
})
|
|
)
|
|
.optional(),
|
|
secondaryEmails: z
|
|
.array(
|
|
z.object({
|
|
id: z.number(),
|
|
email: z.string(),
|
|
isDeleted: z.boolean().default(false),
|
|
})
|
|
)
|
|
.optional(),
|
|
});
|